Adding cart attributes to order status page

Solved
Crafty_Support
New Member
2 0 0

Hello!

I've been trying to include a cart attribute into a customers Order Status page. I've tried it several different ways syntactically but it hasn't worked. 

The form input looks like this: 

<input id="date" type="text" name="attributes[Delivery Date]" readonly='true' required >

 

And the code for the "Additional Scripts" for added checkout customization:

 

<script>
{% for attribute in attributes %}
    {% if {{ attribute | Delivery Date }} %}
        Shopify.Checkout.OrderStatus.addContentBox(
            '<p>Your Delivery Date is: {{ attribute | Delivery Date }}</p>'
        )
    {% endif %}
{% endfor %}
</script>

 

If anyone can help with where my error might be, I would greatly appreciate it! 

Thanks in advance!

0 Likes
Guleria
Shopify Partner
1759 371 520

This is an accepted solution.

Try this one

 

<script>
  {% if order.attributes["Delivery Date"]  %}
    Shopify.Checkout.OrderStatus.addContentBox(
	 '<h2>Your Delivery Date is::</h2>',
      '<p style="padding-top: 8px;"><strong></strong> {{ attributes["Delivery Date"] }}</p>',
 
    )
  {% endif %}
</script>
Want to modify or custom changes on store hire me.
Email: guleriathakur43@gmail.com, Skype: navrocks1
If helpful then please Like and Accept Solution.
Buy me a coffee ☕ My PayPal
Crafty_Support
New Member
2 0 0

Thank you so much!

 

All the documentation I read was pointing to the "checkout" or "cart" object. I never thought of "order"!

 

You are awesome.

0 Likes
robertoe135
New Member
4 0 0

Hi @Guleria,

 

This is not workig for me for some reason. What am I doing wrong?

0 Likes