How to add cart attributes and cart note to email notification?

Abbyxia
Tourist
14 0 3

Hi There,

We add cart attributes to our cart.liquid. and tried to add those attributes to our email notification. here is the code in our cart template:

<p class="cart-attribute__field">
              <input type="hidden" name="attributes[delayed-delivery]" value="No">
              <input type="checkbox" name="attributes[delayed-delivery]" value="Yes"{% if cart.attributes["Delayed Delivery"] == "Yes" %} checked{% endif %}>
              <label>Delayed Delivery</label>
            </p>
            <textarea name="note" id="CartSpecialInstructions" class="cart-note__input"  placeholder="Tell us which week within the next 90 days you would like your tiles delivered. DD/MM/YYYY">{{ cart.note }}</textarea>

Here is the code we added to the email notification:

{% for attribute in attributes %}
<div class="order-note">
Order Note: {{order.note}}
Attribute: {{ attributes.delayed-delivery }}
</div>

We also added a code to the checkout.

<script>
  
{% if order.note != blank %}
   Shopify.Checkout.OrderStatus.addContentBox(

     '<h2>Order notes</h2>',
  'Attributes: {{ cart.attributes.delayed-delivery }}',
     '<p>{{ order.note }} </p>'
    )
{% endif %}

</script>

Only the order note is working on the status page. How can we add the cart note and the cart attributes to our order email notification?

Thanks

Abby

Replies 0 (0)