What's your biggest current challenge? Have your say in Community Polls along the right column.
Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

Why after removed one item from order "TOTAL_WEIGHT" field not changing in Shopify Orders API?

Why after removed one item from order "TOTAL_WEIGHT" field not changing in Shopify Orders API?

RekhaPreetam
Tourist
11 0 3

After remove item from order "TOTAL_WEIGHT" field not changing in Shopify Orders API i.e. "GET /admin/api/#{api_version}/orders/#{order_id}.json".

I have placed order contains two products then from shopify admin portal removed one product item from order.

Steps to follow:
1. Go to Shopify admin portal
2. Click "Orders" in menu
3. Click on one of the order having Authorized payment status.
4. Click "Edit order" icon
5. Click on "Remove item" link of one of the product item
6. Click on "Update order" button
7. Check order data using shopify Order API.

Expected Result: "TOTAL_WEIGHT" field should update in Order API.

Actual Result: "TOTAL_WEIGHT" field not updated in Order API.

Replies 7 (7)

Josh
Shopify Staff
1134 84 235

Hello @RekhaPreetam , 

 

Thanks for pointing this out! It's worth noting that the order editing feature hasn't launched yet, so what you're seeing is not necessarily the final product. I'll make sure that I bring this up with the team working on it though if they haven't already been made aware, as this seems like it may have just been an oversight. 

 

Thanks again for letting us know! 

Josh | Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit the Shopify Help Center or the Shopify Blog

RekhaPreetam
Tourist
11 0 3

Did you solved this TOTAL_WEIGHT issue?

Josh
Shopify Staff
1134 84 235

Hello @RekhaPreetam , 

 

At the time, this is actually known behaviour that is meant to occur - the weight is not recalculated when line items are edited.

Josh | Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit the Shopify Help Center or the Shopify Blog

ZohoInventory
Shopify Partner
4 0 4

Hi @Josh

When an item is removed from an Order the total_price value doesn't decrease. However, if an item is added by editing the Order, the total_price increases accordingly. Doesn't this seem to be inconsistent? Ideally, the total_price should have decreased when the item is removed from the Order. 

 

If such an Order is fetched from Shopify via API, is it up to us to ignore the items that are removed and recalculate the total/discount/tax accordingly?

Josh
Shopify Staff
1134 84 235

Hey @ZohoInventory,

 

At this point that is the expectation, yes - you should be able to use the refund_line_items to calculate the correct values.

 

This is an issue we're aware of though, and will hopefully have a solution for soon. Do you mind me asking some more specifics about the issue that this would resolve for you? Is it just a matter of the inconsistency and being able to surface the correct price to a merchant somewhere without having to do the calculations manually? 

Josh | Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit the Shopify Help Center or the Shopify Blog

ZohoInventory
Shopify Partner
4 0 4

Hi @Josh,

 

Thank you for your reply.

 

If we do the manually calculate the correct total ourselves by referring the refund_line_items we might run into rounding off error(not to mention the additional overhead). So that is why we expect the correct value to be sent for total_price.

Can we get an ETA for this?

Origins
Visitor
2 0 1

1 year after still not working...