Add To Cart
When Add to Cart is enabled, a result card shows the cart button if the selected variant has an add-to-cart link. The button opens that URL and your shop handles the cart and checkout.
Provide the URL for each variant you want shoppers to add from the quiz. Use the URL format your shop accepts. For example, your shop might use a product ID and quantity.
https://www.yourshopname.com/cart/add?quantity=1&id=productID
Set it up
Section titled “Set it up”-
Add an attribute named
add_to_cart_linkto your product data feed. Give each eligible variant its own cart URL.SKU add_to_cart_link 1234 https://www.yourshopname.com/cart/add?quantity=1&id=12341235 https://www.yourshopname.com/cart/add?quantity=1&id=1235 -
Contact support@neocom.ai or your Customer Success Manager. Neocom checks that the attribute works and switches the button on for your quiz.
-
Style the button under Setup › Theme Designer › Results › Add to Cart (Theme Designer); the text of the regular CTA button is set under Results.
Verify the cart action
Section titled “Verify the cart action”Open a published quiz on a test page, click Add to Cart and confirm that the cart contains the intended variant. Check a variant without a cart URL as well. Its result card should still link to the product page and omit the cart button.
Shop Agent cart integration
Section titled “Shop Agent cart integration”The Shop Agent’s button needs no feed attribute: it fires an ADD_TO_CART event through window.neocomActionCallback with the product’s SKU and title, and your JavaScript calls the shop’s cart API. The quiz’s button needs the add_to_cart_link attribute and no code. Both are activated by Neocom. For the agent, see Add to Cart; to see which purchases the quiz assisted, Purchase Tracking.