Skip to content

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
Both results link to the product page. Beside City Step’s View product button is a separate cart icon with a plus. Road Step has only View product.
  1. Add an attribute named add_to_cart_link to 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=1234
    1235 https://www.yourshopname.com/cart/add?quantity=1&id=1235
  2. Contact support@neocom.ai or your Customer Success Manager. Neocom checks that the attribute works and switches the button on for your quiz.

  3. Style the button under Setup › Theme Designer › Results › Add to Cart (Theme Designer); the text of the regular CTA button is set under Results.

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.

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.