Redirect Add to Cart button to partner site

Highlighted
New Member
5 0 0

I'm building a new site where we will sell product as well as direct people to a site we are an affiliate of to purchase there.  I'm trying to create a second theme that will read "visit partner" instead of "add to cart".  When clicked the customer will be taken via our custom affiliate url to the directed page.  

Is there an app for this?  Is there a way to do this on the backend?  Is there a way to automate this process where it automatically pulls the URL and I don't have to do it manually for each product?  

Any help is greatly appreciated

 

0 Likes
Highlighted
Shopify Staff
Shopify Staff
537 0 84

Hey, Michael!

Savannah here from Shopify. :)

That definitely is possible, through the use of an app or with a bit of custom coding. 

If you're comfortable with coding, you can create a new product template with the Add to Cart button redirected to your parter page. Then, you'll navigate to the Add to Cart button in your new product template. The button will differ for every theme, but in Debut it looks like this:

<button type="submit" name="add" id="AddToCart-{{ section.id }}" {% unless current_variant.available %}disabled="disabled"{% endunless %} class="btn product-form__cart-submit{% if product.options.size == 1 and product.variants[0].title == 'Default Title' %} product-form__cart-submit--small{% endif %}">
  <span id="AddToCartText-{{ section.id }}">
    {% unless current_variant.available %}
      {{ 'products.product.sold_out' | t }}
    {% else %}
      {{ 'products.product.add_to_cart' | t }}
    {% endunless %}
  </span>
</button>

Replace the button with this code:

             

 <button type="button" onclick="window.location.href='https://www.shopify.com'"name="add" id="AddtoCart-{{ section.id }}" {% unless current_variant.available %}disabled="disabled"{% endunless %} class="btn product-form__cart-submit{% if product.options.size == 1 and product.variants[0].title == 'Default Title' %} product-form__cart-submit--small{% endif %}">
                <span id="AddToCartText-{{ section.id }}">
                  {% unless current_variant.available %}
                    {{ 'products.product.sold_out' | t }}
                  {% else %}
                    {{ 'products.product.add_to_cart' | t }}
                  {% endunless %}
                </span>
              </button>


Instead of the Shopify link, you'll add your own Partner link instead! 

If you're not comfortable with coding, you can also use an app called Outlink.

Let me know if you have any further questions!

Savannah | Social Care
support@shopify.com

0 Likes
Highlighted
New Member
5 0 0

Great; I have a plug inn from Bold which is recurring membership and would like that my customers are redirected to the sign up page which I created in shopify: Is it possible to use the link then from the sign up page?

0 Likes
Highlighted
New Member
1 0 0

Hi There

I am looking to have the same feature installed on certain products with in our website using the Broadcast Theme. We want certain product to relink to our partners website. I also want the 'Add to Cart' button to read the name of the shop we want the button to redirect to. How is this possible to achieve. Thanks so much for your help.

0 Likes