Home About Blog Terms Docs Contact

Installing the PreProduct snippet

 

Shopify Store 1.0 Install #

 

Summary #

To manually install PreProduct onto your storefront, you will need to copy and paste <div id="preproduct-pledge" data-id="{{product.id}}" data-starting-variant={{ product.selected_or_first_available_variant.id }} style="text-align:left!important;"></div> 

 

into your product page theme file (which will be called something like product-template.liquid, product-form.liquid, product-main.liquid etc) on a new line after {% endform %}

 

or wherever on the product page you would like the PreProduct widget to appear. Below is a quick guide on how to do this.

 

 

Step by step #


1. Copy the following code snippet to your clipboard:
 

<div id="preproduct-pledge" data-id="{{product.id}}" data-starting-variant={{ product.selected_or_first_available_variant.id }} style="text-align:left!important;"></div>

 


2. Click on Online Store in your Shopify toolbar, followed by the Actions button above the preview of your store, then click Edit code from the dropdown menu.

 


open theme editor

 


3. Now enter product into the left-side search bar of your theme editor. We’re looking for the file which contains your buy buttons. In order of likeliness to contain it, here are the most common file names:  ‘product-buy-buttons.liquid’,  ‘product-form.liquid’, ‘main-product.liquid’, ‘product-template.liquid’, ‘product.liquid’


Now you can paste the code snippet anywhere you would like the pre-order button to appear on the page. Placing it after your buy-now form is often best. If you click command+f (Mac) or control+f (windows), then type in endform. You should see one of the below examples, it should have {{ form | payment_button }} somewhere in the nearby lines above it. If you don’t see a promising match, pick another file to search.

 

{% endform %}
or
{%- endform -%}

 


4. Paste the PreProduct code snippet from step 1 onto a new line after the above. Now save your theme.


stage-2-add-snippet



Any problems setting up, don’t hesitate to email us at hello@preproduct.io and we will help you get up and running.

 

 

Manual uninstall

#

To manually uninstall PreProduct from your storefront, you will need to do the exact opposite of the above. <div id="preproduct-pledge" data-id="{{product.id}}" data-starting-variant={{ product.selected_or_first_available_variant.id }} style="text-align:left!important;" ></div> 

 

Finding the snippet in your product page theme file, and deleting it.

 
 
 
 
 

 

Shopify Store 2.0 Install (themes created after Aug 2021) #

 


The Shopify 2.0 update enables PreProduct to be added from the drag-and-drop theme customizer in the Shopify admin. Below is a GIF on what this looks like.
(please note that the PreProduct widget won’t show properly unless previewing in your live storefront).

 

store 2.0 install proccess

 

*The PreProduct widget should only be added to the product page. This can be done by navigating through the customizer preview until you are on a single product page.