<aside> ‼️ This document may be outdated. Please refer to the latest version here

</aside>


Background

You just installed the Shopify Plugin and you’d like to set up your first token-gating campaign for testing. Following these steps will typically get you up and running in 5 minutes or less.


Table of Contents


Add PERCS code snippets to your theme - Part 1

<aside> 🖱️ No coding needed! Just copy + paste as described below.

</aside>

  1. From the Admin page access your theme via “Online Store” → “Actions”→ “Edit code”

    Untitled

  2. Search for and open main-product.liquid

    <aside> 🔑 If you don’t have the main-product.liquid file use the instructions on this page

    How do I install the PERCS Shopify Plugin if I don’t have a main-product.liquid file

    </aside>

  3. Add this snippet to the top of your main-product.liquid page

    <!-- PERC: BEGIN -->
    {% liquid
      assign perc = false
      assign hideCart = false
      assign percCheckout = false
      for tag in product.tags
        if tag contains 'perc:'
          assign perc = true
          if tag contains 'perc: access'
            assign hideCart = true
          endif
          if tag contains 'perc: checkout'
            assign percCheckout = true
          endif
        endif
      endfor
    %}
    {% if perc %}
    {% if hideCart %}
    <style>
      .perc_product-form {
        display: none;
      }
    </style>
    {% endif %}
    <div>
      {% if percCheckout %}
      {% else %}
      	<nft-connect 
                     product="{{product.id}}" 
                     variant="{{product.variants[0].id}}"
                     selector=".perc_product-form"/>
      {% endif %}
      <script type="text/javascript" src="{{ 'nft-connect.js' | asset_url }}"></script>
    </div>
    {% endif %}
    <!-- PERCS ENGAGE: END -->