1
votes

I have made this page https://tns.webwars.eu. This is a form that creates a skymap in away by filling the fields and then posts the data to https://the-night-sky.com/cart. I am using the cart.attributes feature at the moment but this applies for the whole cart and I want individual data for each item. Eg. If someone tries to add another map with different information.

Is there another way to pass the field values to the cart and therefore to checkout and confirmation email?

Thank you in advance

2

2 Answers

2
votes

You should use Line Item Properties as described in good detail here: https://help.shopify.com/en/themes/customization/products/features/get-customization-information-for-products

That technique is per product, works perfect with the cart, checkout and admin, and is much easier to maintain than cart attributes.

0
votes

You can use Shopify's Ajax API for that purpose: https://help.shopify.com/en/themes/development/getting-started/using-ajax-api

Shopify provides shop-owners with an Ajax API that returns JSON-encoded responses.

This Ajax API makes it possible to add items to the cart, update quantities in the cart, and fetch information about the cart, without a page refresh. With this API, you can also fetch information about a particular product using its handle.

For example, on site: https://weedrepublic.com