Hey I am trying to redirect my ADD TO CART button to go straight to my cart page instead of staying on product page
below is my product.liquid code if anyone knows where/what I need to change!
I am using Debut theme
{% include ‘spurit_stp-product-snippet’ %}
{% comment %}
The contents of the product.liquid template can be found in /sections/product-template.liquid
{% endcomment %}
{% section ‘product-template’ %}
{% section ‘product-recommendations’ %}
{% if collection %}
{% endif %}
{% assign current_variant = product.selected_or_first_available_variant %}
Hi @emmaormesher
If you want to remove ajax add to cart and want to send user to cart page after add to cart then follow this:
open Section->product-template.liquid → find class “product-form__cart-submit ” and remove this class.
open Asset->theme.scss file add below code at bottom of page:
[name="add"]{width:100%;}
Johan12
February 29, 2020, 9:52pm
3
Hi, someone can help. How to change the setting of the “Add to cart” button. After adding to the cart, it immediately redirects to the cart, how to cancel it?
Which theme you have and send store url,
you have to find ajax cart function in asset->theme.js file where from you can set 'location.href=“/cart” in success function.
As i can see you can not redirect to cart page after adding to cart.
No, this is exactly what I wanted, thanks, I found a solution to this problem.
I’m having issues with the same problem - add to cart doesn’t go to cart page. Can anyone assist?
Hello I am having the exact same problem. I want my customers to click on “Add to Cart” and be redirected to “View Cart” page. How should I do it?
GO to Asset->theme.js file and find:
this._setupCartPopup(item);
Now comment it and add below code next to this line:
location.href=‘/cart’;
Look like this:
Blts03
July 27, 2020, 7:03pm
14
Hi there,
I’m looking for the same thing, I would like to redirect people to the cart after clicking on Add To Cart. I have Narrative theme, can you help?
Website: https://boostedself.com/
Thank you
Blts03
July 28, 2020, 6:48pm
16
Thanks that worked!!!
In future I will likely want to test taking them directly to checkout as apposed to the cart, how would I do that?
Cheers
You can enable “dynamic buy button” from theme editor->product page.
That take user to direct checkout, but if you want with add to cart button then need custom code.
Hi there,
i need the same for my store: la-pietra.myshopify.com
Can you help me?
Regards.
for your store need to check in code cant say direct much Js error may be affecting.
so may you need an access?