Add Loyalty ID to Cart Page With Cart Attributes - Maingate

WHEN TO USE

Use this technique when you have a store that needs to collect more customer information such as a loyalty ID. That information needs to pass to the order details page and be searchable through the .JSON FILE.

FURTHER READING

https://help.shopify.com/themes/customization/cart/get-more-information-with-cart-attributes

CART.LIQUID

Open cart.liquid and add the following code above the notes section.
<p class="cart-attribute__field">
	<label for="loyalty-id">Loyalty ID</label>
	<br />
	Do you have a loyalty ID? Enter in the box below.<br>
	<input id="loyalty-id" type="text" name="attributes[Loyalty ID]" value="{{ cart.attributes["Loyalty ID"] }}">
</p>
 

Leave a comment