Swapping out the "add to cart" button with amazon affiliate link - What is the best method?

Highlighted
Tourist
4 0 1

I am looking to switch some of my products on http://protechparts.ca that we have decided not to keep in stock to amazon products. I have been using ShopifyFD and custom fields to successfully add a buy now link but this is where I am stuck. I need to have the existing "add to cart button removed and have a new button added with my link.

 

If anyone could point me in the right direction, that would be awesome!

Here is a link to an example of my progress: http://protechparts.ca/products/blackberry-q10-lcd-digitizer-assembly-screen?variant=902462143    *note the "order here!" link :)

 

Thanks in advance!

1 Like
Shopify Staff
Shopify Staff
84 0 3

Hey Dylan!

We actually have a tutorial that goes over how to replace the add-to-cart button with a different link - however if you're looking to just change that button text, and where it links to:

  1. To change the text: look for the class: 'addToCartText' - and replace '{{products.product.add_to_cart | t}}' with whatever you want your title to be.
  2. To link the button somewhere else, you should be able to add some fancy javascript to your button class:
    <button onclick="window.location.href=';

    If you have any trouble along the way, we actually have some awesome design experts who shouldn't have any problems lending a hand here :)

Cheers, Elliot
support@shopify.com

1 Like
Tourist
4 0 1

Wow I couldnt have asked for a better answer! Thanks for the awesome and prompt response :)

0 Likes
New Member
2 0 0

Hi Elliot,

sorry but I'm very new to this, can you explain step by step where exactly I need to plant those codes?

What I want to do is  to link the add to cart buttons for each product to a specific external URL (which are product detail pages in a different website). 

 

thanks alot for your help!

 

0 Likes
New Member
1 0 0

I followed that tutorial, though I am stuck at this step: 'Finally, visit each product page in your shop Admin. Locate the Templates section'

Where is this Templates section??? I don't see it & no one at customer service knows.

0 Likes
New Member
1 0 0

Good morning shopify team/community!  

The way I read it, these methods reqiure creating a custom template for every single product you want to have a unique "Buy on XXXX" link, which seems like an absolute nightmare to setup and maintain.  Has anyone created a plugin (or "App") where a field shows up in the product admin interface where you can check a box that say "This is an affilate product" and then it presents you with a box to add the off-site url?  

Seems like a much better way to do this sort of thing. 

Any other creative ideas?

0 Likes
New Member
1 0 0

Hi, I've replaced the add to cart button with        

<input type="button" value="Buy" onclick="window.location.href='affiliate.url';"/> but  it leads not to affiliate shop but to shopify comming soon page - http://plattya.myshopify.com/password

 

please advice

 

0 Likes