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
When using the Cart Transform function to update the price of a line item it returns line.cost.totalAmount.amount as the price of the line item multiplied by the quantity for normal products but for custom line items it returns the value as just the price of one line item, disregarding the quantity.
While it may seem simple to just change the calculation to account for quantity too, this would fix one problem and create another, as normal products don't require you to account for quantity when using totalAmount.amount but custom line items do.
Steps to reproduce
Create cart transform function to update line item.
Create draft order with the item in question along with a custom line item
Adjust the quantity of the custom line item
Create Add normal product to order/draft order
Adjust quantity of normal product
Expected behavior
line.cost.totalAmount.amount should return the total amount of the line with the quantity already accounted for for custom line items, or if it's already working as intended then line.cost.totalAmount.amount should return the total amount of the line without the quantity account for for normal products.
Packages
"@shopify/app": "^3.58.2",
"@shopify/cli": "3.66.1",
"@shopify/shopify_function": "0.0.3",
Describe the bug
When using the Cart Transform function to update the price of a line item it returns
line.cost.totalAmount.amount
as the price of the line item multiplied by the quantity for normal products but for custom line items it returns the value as just the price of one line item, disregarding the quantity.While it may seem simple to just change the calculation to account for quantity too, this would fix one problem and create another, as normal products don't require you to account for quantity when using
totalAmount.amount
but custom line items do.Steps to reproduce
Example code:
Expected behavior
line.cost.totalAmount.amount
should return the total amount of the line with the quantity already accounted for for custom line items, or if it's already working as intended thenline.cost.totalAmount.amount
should return the total amount of the line without the quantity account for for normal products.Additional context
Video demo of issue:
https://youtu.be/5ejoPdP_akw
The text was updated successfully, but these errors were encountered: