Right now the code below fills in a table that displays all orders placed by my customers on their member dashboard. When a manual change is made to replace one item with another the price column displays the total for both items even though one has been removed. This is because order.total_price is being called instead of order.current_total_price. When I make the change in the code nothing shows up in the table. I’ve attempted this with multiple other order attributes with the same result. No error is generated but the column shows up as blank.
{%- if customer.orders.size == 0 -%}
{{ 'customer.account.no_orders' | t }}
{{ 'customer.account.start_shopping' | t }}
{%- else -%}
{%- paginate customer.orders by 50 -%}
{%- for order in customer.orders -%}
{%- endfor -%}
| {{ 'customer.orders.order_number' | t }} | {{ 'customer.orders.date' | t }} | {{ 'customer.orders.payment_status' | t }} | {{ 'customer.orders.fulfillment_status' | t }} | {{ 'customer.orders.total' | t }} |
| - | - | - | - | - |
| {{ order.name }} | {{ order.created_at | date: format: 'month_day_year' }} | {{ order.financial_status_label }} | {{ order.fulfillment_status_label }} | {{ order.total_price | money }} |
I don’t quite understand what you mean by a manual change is made to replace one item with another. There is no property for current_total_price on the order object, so it’s going to return nothing. Some screenshots showcasing the issue would help. Here’s the order object and a list of it’s properties you can call:
I was under the assumption that I could call anything from the Shopify API but I see this is not the case.
For example in the order below one product is removed and one added. The total should be $395.11 but instead order.total_price returns $790.22. In the API order.total_price also returns $790.22 but I can call order.current_total_price which returns the correct amount of $395.11. This appears to be a Shopify issue since the change displays properly on the web interface but doesn’t in the liquid object.
Oh okay, so you removed it on the order itself and you’re saying it’s still returning you information based on the initial order in your liquid file. Hm, that’s interesting I haven’t encountered this issue before. Did you refund that portion of the order? There’s a order.total_refunded_amount property. You could make a check to see if it’s greater than 0 and if it is, subtract it from the total_price. Also there’s a order.transaction property that returns an array of all transactions for the order, maybe the information you need will be in there.
No refund just a manual edit. Add one item and remove another. I may be able to work around the issue using transaction properties this seems to me like something that needs to be fixed.
Should I create a Github issue/pr and if so can you direct me to the best place to do so?
I don’t know how helpful that will be honestly, Shopify isn’t super responsive with this kind of stuff. They’ve had “features” on their docket for years. Maybe they can point you in the right direction though.