Add buy on Amazon button and link to amazon page

Highlighted
Explorer
54 3 12

There should be a file under edit code>sections that is something like product.liquid or product-template.liquid.

In that file find the closing tag for the form </form> and paste the snippet there. Then make sure one of your products has an amazon url in their product tags.

https://drdigitaldev.com Custom Digital Agency Site Built Entirely on Shopify
0 Likes
Highlighted
New Member
5 0 0

Hi,

Thanks for your reply.

I can find the product.liquid and product-template.liquid files, but there is no </form> in the two files.

Is there anything wrong. 

Would it be possible to have your email so we can communicate via email.

Many thanks.

 

0 Likes
Highlighted
Explorer
54 3 12

dakota@drdigitaldev.com

https://drdigitaldev.com Custom Digital Agency Site Built Entirely on Shopify
0 Likes
Highlighted
New Member
5 0 0

I have attached the product liquid code and product template liquid code pictures here and could you please check them?

Where should i put the buy on amazon button.

I am really sorry for the trouble and many thanks for your kindly help.

product liquid:

{%- comment -%}
  The contents of the product.liquid template can be found in /sections/product-template.liquid
{%- endcomment -%}

<div itemscope itemtype="http://schema.org/Product" class="product_page_mobile_slider_no_margin_top">
  <meta itemprop="name" content="{{ product.title }}">
  <meta itemprop="url" content="{{ shop.url }}{{ product.url }}">
  <meta itemprop="image" content="{{ product.featured_image.src | img_url: '800x' }}">

  {% section 'product-template' %}

</div>

{% include "modal-video" %}

<script>
  global_quantity = {};
  {% for variant in product.variants %}
  {% if variant.inventory_policy == "continue" %}
      global_quantity[{{ variant.id }}] = 'continue';
  {% else %}
      global_quantity[{{ variant.id }}] = {{ variant.inventory_quantity }};
  {% endif %}
  {% endfor %}
</script>
 
 <div id="shopify-ali-review" product-id="{{ product.id }}"> {{ shop.metafields.review_collector.review_code }} </div>

 

product template liquid:

{%- assign product_meta = product.metafields.description -%}
{%- assign sale_on = false -%}
{%- if product.selected_or_first_available_variant.compare_at_price > product.selected_or_first_available_variant.price -%}
  {%- assign sale_on = true -%}
{%- endif -%}

{%- comment -%} Main Image URL. {%- endcomment -%}
{%- assign main_url_image = product.featured_image -%}

{%- comment -%}
date_difference = 60 * 60 * 24 * day counter, this is new product period in seconds
{%- endcomment -%}
  {%- assign date_now = 'now' | date: "%s" -%}
  {%- assign date_published = product.published_at | date: "%s" -%}
  {%- assign date_difference = date_now | minus: date_published -%}
  {%- assign date_limit = 86400 | times: settings.new_product_period -%}
  {%- assign pr_variant = product.selected_or_first_available_variant -%}
  
{%- assign item = section.settings -%}

{%- include item.page_design -%}
{%- if item.show_share_buttons -%}
<div class="container-indent wrapper-social-icon">
  <div class="container text-center">
    {%- include 'addthis' -%}
  </div>
</div>
{%- endif -%}

{%- capture upsellcollection -%}{%- include "product-page-upsellcollection" -%}{%- endcapture -%}
{%- assign upsellcollection = upsellcollection | strip -%}
{{ upsellcollection }}

{% schema %}

0 Likes
Highlighted
Shopify Partner
1 0 0

I have added to the code. The button has been shown out but nothing happened after clicked the button.... 

 

0 Likes
Highlighted
New Member
3 0 0

Hey, where do you install this code?

And do I need to add it?

Thanks for your help. 

0 Likes
Highlighted
New Member
2 0 0

Hello thank you so much for your help. I add the snippet as per your instruction and it works for my. But it can not be aligned with shopify's original button, could you suggest how to make it align? here's the screenshot and our website: https://www.petduro.com/products/petduro-undercoat-rake-brush-for-dog-grooming-comb-dematting-deshed...

 

make it align.png

0 Likes
Highlighted
New Member
3 0 0
Hey Jay

Sorry, I don't know, I actually want to know how did you add that button?

Thank you.
0 Likes
Highlighted
New Member
3 0 0

Hey 

 

I don't know, I'm actually would like to add that button to my listing. Can you tell me how you did it?

 

Thank you. 

0 Likes
Highlighted
New Member
2 0 0

Just past the snippet here shown on this screenshot: http://prntscr.com/sgga1r. bty, I'm using Supply Themes.

 

Snippet:

 

{% for tag in product.tags %}
{% assign productTag = tag | downcase %}
{% if productTag contains 'https://' %}
<form action = "{{tag}}">
<input type ="submit" class = "btn" value = "Buy on Amazon with Big Sale">
</form>
{% endif %}
{% endfor %}

0 Likes