Can the 'Add to Basket' button in Shopify redirect to the product page?

shaunsnaith
Tourist
56 0 1

Hello All,

At the moment on our collection pages the 'Add to Basket' button will add a product to cart and send them to said cart.  However we want to change it that so that it takes the customer to the product page.  Is there are way of doing this.  I know how to change the button text no problem but changing the link where the button directs is proving difficult.

Is there anyone that can help with this?

I've asked elsewhere but not had any responses.  From what I can see it's this code that needs changing but I've tried searching the code but can't find it to edit it and when I do find it I have no idea what to change it to to make it work.

shaunsnaith_0-1631801813112.png

 

Replies 6 (6)

IttantaTech
Shopify Partner
525 55 102

Hello , @shaunsnaith 

I don't get much idea from the code given.

But you can try like this. Just remove the code between <li></li>

and put this code :- <a href="{{product.url}}">your button name</a>

Thanks,
Ittanta Technologies Pvt. Ltd. | Shopify Expert
If reply is helpful, please Like and Accept Solution.
To hire us, contact us at info@ittanta.com

LitExtension
Shopify Partner
4860 1001 1132

Hi @shaunsnaith,

Please change code as below:

<form action="/cart">
<input type="submit" value="View Basket" class="btn auto-full-width outline" />
</form>
=>
<a href="{{product.url}}" class="btn auto-full-width outline">View Basket</a>

Hope it helps!

If my answer can help you solve your issue, please mark it as a solution. Thank you and good luck

LitExtension - Shopping Cart Migration Expert
Check out our Shopify migration app to migrate your online store to Shopify
shaunsnaith
Tourist
56 0 1

Thanks, we'll give that a try.

shaunsnaith
Tourist
56 0 1

@LitExtension could you confirm which file I need to use to replace that code, I'm struggling to find the correct one.

LitExtension
Shopify Partner
4860 1001 1132

Where did you find the screenshot?

Or you can send me the code of the sections/collection-template.liquid file. I will check and show you how to find the correct file.

LitExtension - Shopping Cart Migration Expert
Check out our Shopify migration app to migrate your online store to Shopify
shaunsnaith
Tourist
56 0 1

I viewed the source of the live site.  We ended up getting a guy to sort the code out for us, I didn't want to risk screwing the site up for the sake of $20.  Thanks for your help though.