-
Notifications
You must be signed in to change notification settings - Fork 318
[Shopify] Item Attributes as Product Options #6248
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
[Shopify] Item Attributes as Product Options #6248
Conversation
…ns in Shopify product creation
…hopify product creation
…utes (checks for existing product options and ensuring unique combinations)
…rt Product codeunit. updated references
…Porduct Options utilized
|
Could not find linked issues in the pull request description. Please make sure the pull request description contains a line that contains 'Fixes #' followed by the issue number being fixed. Use that pattern for every issue you want to link. |
…ure by moving Item Attributes check outside of procedure
| /// <summary> | ||
| /// Enum Shpfy Incl. in Product Sync (ID 30179). | ||
| /// </summary> | ||
| enum 30179 "Shpfy Incl. in Product Sync" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do you really need enum? it looks like a boolean
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Enum in case we will decide to extend it and send to Tags or Specific fields (let's say Brand attribute to be mapped to Manufacturer field in Shopify). Not in scope at this point.
| { | ||
| field("Shpfy Incl. in Product Sync"; Rec."Shpfy Incl. in Product Sync") | ||
| { | ||
| ApplicationArea = All; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no visibility controls? is it always visible?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree. At least one shop where Enabled - true.
| if ShopifyProduct."Has Variants" and (OptionName <> VariantOptionTok) then begin | ||
| ProductExport.SetShop(Shop); | ||
| if not ProductExport.ValidateItemAttributesAsProductOptionsForNewVariant(TempShopifyVariant, Item, '', ShopifyProduct.Id) then | ||
| exit; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
isn't here too late to exit? product option is already updated at this point. if we are not going to continue, should we send the update request to Shopify?
| begin | ||
| ItemAttributeValueMapping.SetRange("Table ID", Database::Item); | ||
| ItemAttributeValueMapping.SetRange("No.", Item."No."); | ||
| if ItemAttributeValueMapping.FindSet() then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
setloadfields?
|
|
||
| Options := ProductApi.GetProductOptions(ShopifyProduct.Id); | ||
|
|
||
| if Options.Count > 1 then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what will happen if user creates product in Shopify, defines option Color and Size.
And later tries to export item as variant (attaching to this product) but either this item has no attributes at all. Or has a different collection of them, like Brand and Color or Brand only or even Color only?
[Shopify] Item Attributes as Product Options
Summary
This PR introduces support for using Item Attributes as Shopify Product Options. Item Attributes marked with "As Option" in the
Shpfy Incl. in Product Syncfield are now synchronized to Shopify as Product Options, enabling variant differentiation based on attribute values (e.g., Color, Size, Material).Changes
New Functionality:
Shpfy Incl. in Product Sync= "As Option" to indicate they should become Shopify Product OptionsValidation Rules:
Tests:
ShpfyItemAttrAsOptionTest.Codeunit.al(ID 139540) with tests for:Fixes AB#605734