Solved

Shopify Version Porto Theme Ver 3.6.1, Need add to cart button to redirect to cart from product page

southminisplits
Tourist
12 1 1

I am not quite yet a full developer, but am working on a website that sells products.

The customer clicks a product

They see the product information, and after selecting a size, they click add to cart

After clicking add to cart, it notifies them that they added to cart with a quick splash saying (you've just added this to your cart) for a quick second, and then you have a choice of either going to cart, or continue shopping, but it quickly goes away.

We would like for it to just redirect FROM the product page TO the cart page with the added product once they add it to their cart. How would I go about doing this? I have some familiarity with the code editor and editing minor code through there, but it is a bit over my head for sure.

I tried going through some of the store code, but it is a bit over my head.

I tried asking chatgpt but they gave me a pretty broad way of how I would supposedly do it.

(and would love for that product to also simultaneously be in their cart as they've added it)

 

URL: https://southminisplits.com/

Accepted Solution (1)

southminisplits
Tourist
12 1 1

This is an accepted solution.

Figured I would give out the solution for anyone that needs it in the future. 

 

I had to remove the add-to-cart class from product_view_default.liquid Worked like a charm.

There are a lot of duplicate files that seem like the product file but you need to find the default one. Once you do that remove the class and it should be fine.  

View solution in original post

Replies 5 (5)

Sweet_Savior_3
Shopify Partner
1201 96 116

Hello @southminisplits 

 

Find the add to cart HTML code in the theme files and remove the class 'add-to-cart' from it >>

Sweet_Savior_3_0-1708015211772.png

 

Thanks

Don't forget to like and accept the solution to help others store owners.
Looking for an expert or Have any queries ? Send query to the Inbox
Coffee Tip ? Pay to shopify.dev.34@gmail.com
From Less To Further !!!
southminisplits
Tourist
12 1 1

Hello, thank you for that. I tried doing that in theme files in a copy of the theme that I have, and when I previewed it, the change seemed to not go into effect and it's just acting the same way. I tried also adding location.href="/cart"; to the button to see if maybe that would redirect to the cart once they click the "add to cart" button but still nothing.

Sweet_Savior_3
Shopify Partner
1201 96 116

Should i check and fix the code if you are looking to hire at reasonable rate ?

 

Thanks

Don't forget to like and accept the solution to help others store owners.
Looking for an expert or Have any queries ? Send query to the Inbox
Coffee Tip ? Pay to shopify.dev.34@gmail.com
From Less To Further !!!
southminisplits
Tourist
12 1 1

Let's talk about it, how do I get ahold of you?

southminisplits
Tourist
12 1 1

This is an accepted solution.

Figured I would give out the solution for anyone that needs it in the future. 

 

I had to remove the add-to-cart class from product_view_default.liquid Worked like a charm.

There are a lot of duplicate files that seem like the product file but you need to find the default one. Once you do that remove the class and it should be fine.