Craft plugin that integrates with the Shopify API
Failed to load latest commit information.
shopify bump version to 1.0.2 after merging in PRs Jan 6, 2017 initial commit May 15, 2014

Craft Shopify Plugin

Craft plugin to integrate with the Shopify API


  1. Move the shopify folder into your craft/plugins directory
  2. Install the plugin in the Control Panel
  3. Enter your Shopify Credentials in the Plugin settings



Retrieve all products from Shopify. You can pass in any parameters that are noted in the products enpoint. Example:

{% for product in craft.shopify.getProducts({ fields: 'title,variants', limit: 5 }) %}
    <div class="product">
        <h2>{{ product.title }}</h2>
            {% for variant in product.variants %}
                <li>{{ variant.title }} - ${{ variant.price }}</li>
            {% endfor %}
{% endfor %}


This is just a slightly modified version of the getProducts method where the array keys are the product ID. So if you have a field named shopifyProduct which stores the Shopify product ID, you can access all the products' variants with a single API call.

{% set shopifyProducts = craft.shopify.getProductsVariants() %}

{% for entry in craft.entries({ section: 'product' }) %}
    <div class="product">
        <h2><a href="{{ entry.url }}">{{ entry.title }}</a></h2>

        {% if entry.shopifyProduct and shopifyProducts[entry.shopifyProduct] %}
                {% for variant in shopifyProducts[entry.shopifyProduct] %}
                    <li>{{ variant.title }} - ${{ variant.price }}</li>
                {% endfor %}
        {% endif %}
{% endfor %}


Useful on product show pages to access Shopify product information. Useful to get a product price or create an add to cart form. This hits the single product endpoint.

{% set shopify = craft.shopify.getProductById({ id: entry.shopifyProduct, fields: 'variants' }) %}

<form action="http://your.shopify.url/cart/add" method="post">
    <select name="id">
        {% for variant in shopify.variants %}
            <option value="{{ }}">{{ variant.title }} - ${{ variant.price }}</option>
        {% endfor %}
    <input type="hidden" name="return_to" value="back">
    <button type="submit">Add to Cart</button>