Hey everyone,
I’m encountering an issue where the total_price is calculated inconsistently across different cart APIs, and it’s leading to discrepancies in the cart totals. This only happens when logged in as a customer, which seems to trigger Shopify to include the shipping cost based on the address.
Here’s the situation:
- Product price: $3,050
- Flat rate shipping: $299
When logged in as a customer, Shopify starts including the shipping cost in the total_price, but only inconsistently across different APIs. Here’s what I’ve found:
/cart.jsand Liquid’scartobject:
total_price: 305000original_total_price: 305000
/cart/update.js’ response after updating the cart with it:
total_price: 334900original_total_price: 305000 (Shipping cost $299 is added tototal_price, butoriginal_total_priceremains unchanged.)
/cart/change.js’ response after updating the cart with it:
total_price: 334900original_total_price: 305000 (Shipping cost $299 is added tototal_price, butoriginal_total_priceremains unchanged.)
Is there any explanation for why the shipping cost is included in the object returned by /cart/update.js and /cart/change.js but not in the /cart.js or Liquid’s cart object? I couldn’t find anything in the documentation that addresses this behavior.
Appreciate any insights!
