Why are line item properties reordering in some Shopify admin pages?

Why are line item properties reordering in some Shopify admin pages?

AlejandroLoz
Shopify Partner
11 0 5

Hi, I'm having a little problem with some Shopify stores regarding the order in which the line item properties appear in the order on the admin page. Here's how the properties are added to a product when adding it to the cart, they are perfectly ordered with all properties starting with an underscore added at the end.

Customily_0-1606317196909.png

However, when viewing the order on the admin Orders page, they are shown like this:

Customily_1-1606317463061.png

The order is altered! What is weird is that this only happens in some Shopify stores. What are the criteria to sort the properties? I can't find anything on the Shopify API regarding the properties ordering.

Thank you in advance!

 

 

Replies 2 (2)

moladukes
Visitor
2 0 0

Having the same issue. Where you able to solve this?

sahilshah50
Shopify Partner
10 0 6

In liquid, I was able to get sorted properties using below code:

{% assign sortedProperties = item.properties | sort_natural %}
{%- for p in sortedProperties -%}