Query Regarding Total Discount Field in Shopify Order Line Items After Cart Transformation

Topic summary

Issue: A Shopify cart transform function reduces item prices by 50% for customers with the “prime” tag (e.g., price 10 → 5). The transform works in the cart.

Observed behavior: When the order is created, the backend receives only the reduced line item price (5). The line_item.total_discount field is nil, showing no recorded discount amount.

Expectation: The poster expects total_discount on each line item to reflect the discount (5 in the example) rather than only the adjusted price.

Context: A cart transform is a Shopify Functions feature that modifies cart/line item pricing before checkout.

Status and asks: They are asking whether total_discount should populate when using cart transforms and if others have encountered this behavior. No confirmations, workarounds, or resolutions provided yet; the question remains open.

Summarized with AI on January 9. AI used: gpt-5.

Hello!

I’ve implemented a Shopify cart transform function where if a customer has “prime” tag, the price of a product is reduced by 50% (e.g., from 10 to 5).

The function works fine.

but when creating an order, the backend is getting only a reduced price (e.g., 5). but no total_discount, the total_discount field inside the line items is showing as nil.

Shouldn’t it display the discount amount (in this case, 5) within the total_discount field for the line items?

Does anyone face a similar situation?