How to turn the add-to-cart button into an external link button?

Dear,
I am using the Refresh theme and would like to change the add-to-cart into an external link button, but I don’t want to use an app. I already found a guide that supports Vintage-Shopify-Themes, but I am using an 2.0-Theme.

I want to do this in bulk, so not just only with one link. It would be great if I could change the external link when I create the product.

Is there any way I can do this?

Best, Wolfi

1 Like

@Wolfi Why don’t you hide add to cart button and add another one with another url? Or maybe, I misunderstood your problem :slightly_smiling_face:

@MarinaPetrovic

I forgot to say that I want to do this at bulk. That means I could hide the add to card button and add a new button. The problem is, I don’t know how to add a button with a changeable external link in the product editor. Do you understand what I mean?

Yeah sure @Wolfi , you’d like to do that for every product page, add button, but each page should have different url. It’s great that you’re on 2.0 theme.
Not a problem. I’m not sure about the file structure on your store. Could you share url so I can take a look?

@MarinaPetrovic

Sorry for the late respawns. What do you mean by Filestrukture? Do you mean the URL to my shop?

Here is my shop link: men-commodity.myshopify.com
Password: sownto

I don’t care if everyone can see this website, I am atm just working on this function only anyway.

1 Like

@MarinaPetrovic Hey again, I would like to know if you could help me soon, because I need to get this to work asap. If not, that’s no problem, I just need to know. Thanks

Hi @Wolfi , when I said file structure, I meant on your files that contain code. When you go to Edit Code > Sections > There are many files. Is there a file called main-product.liquid or product.liquid?
That contains this piece of code:


                    

This submit button is your add to cart button. So we should remove that and add:

```markup

And some styling should come later. :slightly_smiling_face:

@MarinaPetrovic Thanks for the reply. The filename is “main-product.liquid”. Removing the add-to-card button is already working :slightly_smiling_face:

Hi is there a way to just apply this to certain product pages and not all?

@MarinaPetrovic

Hi @jamal4e , sure there is a way. You should add condition that check which product page are you at:

{% if product.url == '/products/product-name' %}
 //your code
{% endif %}

Hello, I have done the search you mentioned and in my code it did not give me any coincidence. Is there another way and should I say another way?

Could we get this updated? Right now I’m trying to solve it and it doesn’t appear the same anymore, I look forward to your comments. Thank you.

1 Like

Can not see the product form button. what do i do next?