You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Cart Transform API with customized bundles. API version 2024-01
Describe the bug
I tried to set up the following logic: merge some products with percentageDecrease e.g. 10% but don't apply 10% discount to a specific component in a bundle and set fixedPricePerUnit to its price - e.g. 9.99 $. In this case output is correct, it shows that given line items got price reduced by 9.99 in update objects and the merge object is also correct with decreasing 10% off.
But in the cart and on checkout page it shows price of the bundle as it would be without decreasing by 9.99. It applies 10% to the whole bundle but doesn't apply 9.99 $ off;
Based on the documentation, if you use the Update and Merge operations on the same cart line, then Shopify will apply both operations, since they do not directly conflict with each other. The Merge operation will merge multiple cart rows into one, while Update will change the properties of that merged row (such as price, image, or title). This is exactly what I was counting on when creating the logic described above. But this does not work as expected, using merge always creates a bundle with product prices without taking into account update operations.
If I don't use merge operation then update operations works as expected but in this case I don't have bundles :(
How I tried to make it work:
Use merge without any price percentageDecrease and use update for any operations with prices
Use merge with 10% percentageDecrease and use update prices for only those line items in the bundle which I need decrease by 9.99$
I also tried to change an order of operations execution (I thought that's an issue of the order)
Steps to reproduce
Use the merge operation and apply some price changes in the update operation you will see that price changes from update operation were not applied
Expected behavior
Using the merge operation and apply some price changes in the update operation - price changes from update operation will be applied together with the price changes from the merge operation
Environment
Operating system - Windows 11
Shopify CLI version - 3.56.3
Additional context
Add any other context about the problem here.
My client has this logic in his Shopify Scripts and we are trying to migrate to Functions API.
Which template or example
Cart Transform API with customized bundles. API version 2024-01
Describe the bug
I tried to set up the following logic: merge some products with percentageDecrease e.g. 10% but don't apply 10% discount to a specific component in a bundle and set fixedPricePerUnit to its price - e.g. 9.99 $. In this case output is correct, it shows that given line items got price reduced by 9.99 in update objects and the merge object is also correct with decreasing 10% off.
But in the cart and on checkout page it shows price of the bundle as it would be without decreasing by 9.99. It applies 10% to the whole bundle but doesn't apply 9.99 $ off;
Based on the documentation, if you use the Update and Merge operations on the same cart line, then Shopify will apply both operations, since they do not directly conflict with each other. The Merge operation will merge multiple cart rows into one, while Update will change the properties of that merged row (such as price, image, or title). This is exactly what I was counting on when creating the logic described above. But this does not work as expected, using merge always creates a bundle with product prices without taking into account update operations.
If I don't use merge operation then update operations works as expected but in this case I don't have bundles :(
How I tried to make it work:
Steps to reproduce
Use the merge operation and apply some price changes in the update operation you will see that price changes from update operation were not applied
Expected behavior
Using the merge operation and apply some price changes in the update operation - price changes from update operation will be applied together with the price changes from the merge operation
Environment
Additional context
Add any other context about the problem here.
My client has this logic in his Shopify Scripts and we are trying to migrate to Functions API.
Here some examples of my code:
run.graphql:
run.js:
Input (STDIN):
Output (STDOUT):
The text was updated successfully, but these errors were encountered: