The Spreadr app can easily be integrated with the themes compatible with Online Store 2.0. This guide will walk you through the process of how to add the integration code to the Dawn Theme.


For integrating older themes refer the integration guide here.


Steps


1. Open your Shopify admin.

2. Click Online Store.

3. Click Themes.

4. Click Actions for your published theme.



5. Click Edit code. 



6. Click the file main-product.liquid which appears under Sections.



7.  The main-product.liquid file will open in the online code editor. In the online code editor window, locate the HTML for your add-to-cart button (you can do this by searching with CTRL-f OR COMMAND-f). The HTML for your add to cart button will look something like this:


<button 

type="submit" 

name="add" 

class="product-form__submit button button--full-width {% if block.settings.show_dynamic_checkout and product.selling_plan_groups == empty %}button--secondary{% else %}button--primary{% endif %}" {% if product.selected_or_first_available_variant.available == false %}disabled{% endif %}

>

{%- if product.selected_or_first_available_variant.available -%}

{{ 'products.product.add_to_cart' | t }}

{%- else -%}

{{ 'products.product.sold_out' | t }}

{%- endif -%}

</button>



The trick is to find a <button> tag that includes the text 'products.product.add_to_cart'.


(If you need assistance please contact support@spreadr.freshdesk.com.)


8. Add the following code encapsulating the <button> code that you found in the step 7.


{% render 'spreadr-custom', product:product, s_showSpreadr:1, s_hideCart:1 , s_classes: 'button button--full-width button--primary', s_style: '' %}


<div class="s_original_{{ product.id }}">


//<button> code


</div>


It will look as shown in the image below. The boxes in blue represent the Spreadr integration code. The box in red is the existing <button> code


 

9. Hit Save.


10. The Add to Cart button on the product pages should now be replaced with the View on Amazon button for Spreadr products,


(If you are having problems please contact support@spreadr.freshdesk.com. We will do the integration for you.)