-
Notifications
You must be signed in to change notification settings - Fork 323
[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. |
onbuyuka
left a comment
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.
looks good other than few nits. here's the testing checklist I went through
Test Checklist for PR #6248 - Item Attributes as Product Options
1. Item Attributes Page - New Field Visibility
- Open Item Attributes page (Search → "Item Attributes")
- Verify column "Incl. in Product Sync" is visible when Shopify is enabled
- Verify column is hidden when no Shopify Shop is enabled
- Verify dropdown options: blank (" ") and "As Option"
- Set an Item Attribute to "As Option" and save
2. UoM as Variant Validation (Shopify Shop Card)
- Open Shopify Shops page → Select a shop → Open Shopify Shop Card
- Ensure "UoM as Variant" is currently OFF
- Create an Item Attribute marked as "As Option" (via Item Attributes page)
- Go back to Shopify Shop Card → Try enabling "UoM as Variant" toggle
- Expected: Error message: "UoM as Variant is unavailable due to existing Item Attributes marked as "As Option"..."
- Remove the "As Option" from all Item Attributes
- Retry enabling "UoM as Variant" → Should succeed now
3. Export Item WITHOUT Variants, WITHOUT "As Option" Attributes
- Create a new Item (no Item Variants)
- Do NOT assign any Item Attributes marked as "As Option" to this Item
- Open Item Card → Click Shopify action group → "Add to Shopify"
- Select a Shopify Shop
- Expected: Product created in Shopify with default variant (no options)
4. Export Item WITHOUT Variants, WITH 2 "As Option" Attributes
- Create 2 Item Attributes (e.g., "Color", "Material") → Set both to "As Option"
- Create a new Item (no Item Variants)
- Assign both attributes to the Item via Item Card → Item tab → Attributes
- Open Item Card → Shopify → "Add to Shopify"
- Expected: Product created with 2 Product Options (Color, Material) and 1 variant
5. Export Item WITH Variants, WITH 3 "As Option" Attributes (Unique Combinations)
- Create 3 Item Attributes (e.g., "Color", "Size", "Material") → Set all to "As Option"
- Create an Item with 2 Item Variants (via Item Card → Item → Variants)
- Assign different attribute value combinations to each variant:
- Via Item Variants page → Select variant → Variant → Attributes
- Add to Shopify
- Expected: Product created with 3 options and 2 variants with unique option combinations
6. Export Item WITH Variants - Duplicate Attribute Combinations (Should Fail)
- Create Item with 2 Variants
- Assign identical attribute value combinations to both variants
- Add to Shopify
- Expected: Item is skipped; Check Shopify Skipped Records page for error about "duplicate item variant attribute value combinations"
7. Export Item WITH More Than 3 "As Option" Attributes (Should Fail)
- Create 4 Item Attributes → Set all to "As Option"
- Assign all 4 to an Item
- Add to Shopify
- Expected: Item is skipped; Check Shopify Skipped Records for error "maximum of 3 product options"
8. Add Item as Variant to Existing Product (No "As Option" Attributes)
- Have an existing Shopify product (synced from BC Item without "As Option" attributes)
- Open Shopify Products page → Select product → Add Item as Variant action
- Select a different Item (no "As Option" attributes)
- Expected: Variant created with Option Name = "Variant", Option Value = Item No.
9. Add Item as Variant - Missing Required Attributes (Should Fail)
- Have a Shopify product with "As Option" attributes (e.g., "Color", "Size")
- Try adding an Item that is missing one of the required attributes
- Expected: Error or skipped entry: "cannot be added as a product variant because it does not have required attributes"
10. Add Item as Variant - Duplicate Option Combination (Should Fail)
- Have a Shopify product with existing variant having Color=Red, Size=Large
- Try adding another Item with same Color=Red, Size=Large values
- Expected: Skipped entry: "another variant already has the same option values"
11. Add Item as Variant - Different Option Values (Should Succeed)
- Have a Shopify product with existing variant having Color=Red, Size=Large
- Add an Item with Color=Blue, Size=Large (at least one value different)
- Expected: New variant created successfully with the correct option values
12. Verify Skipped Records Logging
- For each failure scenario above, navigate to:
- Shopify Shops → Select shop → Related → Skipped Records
- Or search for "Shopify Skipped Records"
- Verify appropriate error messages are logged with correct Record IDs
13. Sync Products (Background Job)
- Have multiple items with various "As Option" attribute configurations
- Run Sync Products from Shopify Shop Card
- Verify products are created/updated correctly based on attribute configurations
- Check Skipped Records for any failures
[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