Docs
  • Purple Dot Overview
  • Getting Started
  • Shopify app integration
    • Installing our Shopify App
  • Platform Integration with Shopify
    • Connect to Shopify
    • Integrate Purple Dot with your Storefront
      • Integrate into Shopify Themes built with Liquid
        • Minimum Theme Requirements
      • Integrate into Shopify Headless Storefronts
        • Integrate into Shopify Hydrogen Storefronts
    • Configure Shipping Rates
    • Test the Platform Integration
    • Pre-order Tracking
    • Migrating from our Shopify App
  • Platform Integration with Salesforce
    • Integrate Purple Dot with Salesforce
      • Upgrading to 2024-08-29
  • Platform Integration With Other Platforms
    • Integrate into Another Platform
  • Platform Integration References
    • Public API
      • /waitlists
      • /availability
      • /products/preorder-state
      • /variants/preorder-state
      • /pre-orders
    • Private API
      • /waitlists
      • /pre-orders
      • /pre-orders/count
      • /pre-orders/count-units/sku/:sku
      • /inventory
      • /fulfillment-orders
      • /fulfillment
Powered by GitBook
On this page
  • Requirements
  • Test your PDP
  1. Platform Integration with Shopify
  2. Integrate Purple Dot with your Storefront
  3. Integrate into Shopify Themes built with Liquid

Minimum Theme Requirements

PreviousIntegrate into Shopify Themes built with LiquidNextIntegrate into Shopify Headless Storefronts

Last updated 1 year ago

For Shopify merchants integrating Purple Dot into Shopify Themes built with Liquid, the theme must meet the 3 criteria below.

If you need help, please contact .

Requirements

Any button that is used to add products to the cart should have the type attribute set to submit and should also be inside the <form> HTML element.

<button type="submit">Add to Cart</button>

Each of these buttons must be wrapped in a <form> element, with the action attribute set to /cart/add.

<form action="/cart/add" method="post">
    <!-- Your Product form content goes here -->
</form>

Within the form, there should be an input or select element with the name attribute set to id. The value of this input element must be updated dynamically based on the current variant selected in the form. This ensures that Purple Dot can correctly identify the selected product variant.

<input type="hidden" name="id" value="{{ variant.id }}"/>

Additional requirement for a select based implementation is that only the option of the variant the shopper had actually selected is selected.

<select name="id">
  {% for variant in product.variants %}
    {% if variant.available %}
      <option
        {% if product.selected_variant.id == variant.id %}
          selected
        {% endif %}
        value="{{ variant.id }}">
        <...>
      </option>
    {% else %}
        <option 
          {% if product.selected_variant.id == variant.id %}
            selected
          {% endif %}
          disabled="disabled"
          value="{{ variant.id }}">
          <...>
        </option>
    {% endif %}
  {% endfor %}
</select>

Test your PDP

Run this code in your console, when on a merchants PDP:

const form = document.querySelector('form[action*="/cart/add"]');
const variantID = form?.querySelector('[name="id"]');
const button = form?.querySelector('button[type="submit"]');

console.log('form should exist -->', !!form);
console.log('form should contain an element identifying the product variant -->', !!variantID);
console.log('form should contain a submit button -->', !!button);
support
1. Add to Cart Button with type="submit" (inside <form>)
2. Form Element with action="/cart/add"
3. Variant selectors