'Adding a "Buy from Amazon" button to my collections shopify pages?

I have my products available on both Amazon and a dedicated Shopify store. For customers looking to take advantage of Prime shipping over what our store can offer I'm looking for a way to add a "buy from Amazon" button next to "Add to Cart" which is an affiliate link to our products.

Any guidance would be much appreciated.



Solution 1:[1]

If you want to redirect to amazon page you can simply add this and style as you see fit

<style>
.amazon-button{
 background-color:#fff;
 padding:10px 8px;
 color:#000;
}
</style>   
<a class="amazon-button" href="store-link">View on amazon</a>

But if you want to redirect it to the dedicated product page on amazon you have to add metafield in products with the corresponding link to amazon.

 {% if your-meta-here != blank %}
    <a class="amazon-button" href="{{your-meta-here}}">View on amazon</a>
    {% endif %}

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Anit