I have a client with several canceled/removed items from an order and they are displayed in the customer area.
I need to hide these items.
In the “Order Printer” app I have managed to don’t show the removed order items. Using:
{% for line_item in line_items %}
{% if line_item.quantity > 0%}
But on the web, detail orders from the customer area, (theme file “customers/order.liquid”)
the if of line_item.quantity > 0 does not work
Customers can see all the items in the order, even if they are removed (see screenshot). It even shows 1 unit, when it is 0.
(in the order printer app it shows 0 units)
I haven’t seen any documentation of liquid variants to create an if to hide canceled or removed line_items.
I would need to know how to do it
Thank you
1 Like
hi @Minifigures_Dis ,
i think you doing used wrong the loop:
your way:
{% for line_item in line_items %}
Correct loop in order page is:
{%- for line_item in order.line_items -%}
{{ line_item.quantity }}
{%- endfor -%}
If you need hire the technical, you can contact to me, thank!
Hi,
Please share your store URL and if your store is password protected then also provide password too.
Thank you.
Hi,
I’m using
{%- for line_item in order.line_items -%}
{{ line_item.quantity }}
{%- endfor -%}
in customers/order.liquid of my theme.
But if I have removed an item from the order it is still displayed.
In this order, the first two items are removed and refunded to the customer:
Same issue. This worked perfectly for me:
{% for line_item in line_items %}
{% if line_item.quantity != 0 %}
I’ve tried your code and it didn’t work for me.
How strange that shopify is not able to not show the products removed from an order
Some help?
thank you