Cart attributes don't appear on admin order page

Highlighted
New Member
1 0 0

Hi Shopify community!

I need to add cart attributes to the cart page.

I used this tutorial https://help.shopify.com/en/themes/customization/cart/get-more-information-with-cart-attributes and Shopify UI Elements Generator https://ui-elements-generator.myshopify.com/pages/cart-attribute, but for some reason, cart attributes don't appear on admin order page.

Here is the code of cart attributes I added to cart.liquid

// assign dates to variables
{% assign secondDay = 'now' | date: "%s" | plus : 86400 | date: "%b %d, %Y" | uri_encode | replace:"+","%20" %} {% assign thirdDay = 'now' | date: "%s" | plus : 172800 | date: "%b %d, %Y" | uri_encode | replace:"+","%20" %} {% assign fourthDay = 'now' | date: "%s" | plus : 259200 | date: "%b %d, %Y" | uri_encode | replace:"+","%20" %} {% assign fifthDay = 'now' | date: "%s" | plus : 345600 | date: "%b %d, %Y" | uri_encode | replace:"+","%20" %} // dropdown list of dates
<p class="cart-attribute__field" style="display:inline-block; margin-right:20px; width:300px;"> <label for="shipping-day-you-prefer">Shipping day you prefer</label> <select id="shipping-day-you-prefer" name="attributes[Shipping day you prefer]" style="width:300px;"> <option value="{{secondDay}}"{% if cart.attributes["Shipping day you prefer"] == {{secondDay}} %} selected{% endif %}>{{secondDay}}</option> <option value="{{thirdDay}}"{% if cart.attributes["Shipping day you prefer"] == {{thirdDay}} %} selected{% endif %}>{{thirdDay}}</option> <option value="{{fourthDay}}"{% if cart.attributes["Shipping day you prefer"] == {{fourthDay}} %} selected{% endif %}>{{fourthDay}}</option> <option value="{{fifthDay}}"{% if cart.attributes["Shipping day you prefer"] == {{fifthDay}} %} selected{% endif %}>{{fifthDay}}</option> </select> </p> <p class="cart-attribute__field" style="display:inline-block; width:300px;"> <label for="must-arrive-date">Must arrive date</label> <select id="must-arrive-date" name="attributes[Must arrive date]" style="width:300px;"> <option value="{{secondDay}}"{% if cart.attributes["Must arrive date"] == {{secondDay}} %} selected{% endif %}>{{secondDay}}</option> <option value="{{thirdDay}}"{% if cart.attributes["Must arrive date"] == {{thirdDay}} %} selected{% endif %}>{{thirdDay}}</option> <option value="{{fourthDay}}"{% if cart.attributes["Must arrive date"] == {{fourthDay}} %} selected{% endif %}>{{fourthDay}}</option> <option value="{{fifthDay}}"{% if cart.attributes["Must arrive date"] == {{fifthDay}} %} selected{% endif %}>{{fifthDay}}</option> </select> </p>

I don't have much experience with Shopiy and liquid, so I could miss something.

Could you help me with this issue?

0 Likes