Redirect to cart after "add to cart" - Debut Theme

Solved
Tourist
6 0 1

I run a 1 product store and would love if add to cart redirects to the cart with the same click. Right now, once add-to-cart is clicked a little notification appears in the top right side of the store notifying me its in the cart and I can choose to go to the cart from there. However since I only sell 1 product this is just 1 unnecessary click and surely leads to abandoned carts.

 

Any help please? 
Thank you

1 Like
Shopify Partner
1891 318 403

Hi @pinkbubble 

You have added ajax cart functionality ? if so then you have to redirect on cart in success of function like "location.href='/cart'".

or you can disable you ajax function its default send form to cart.

Send me store url so i can check.

Want to modify or custom changes on store hire me.
If helpful then please Like and Accept Solution.
Email: jasoliyabrijesh123@gmail.com
Skype: jasoliya.brijesh
0 Likes
New Member
3 0 0

Hey 
can you please explain more, i'm facing the same issue ! i want to Redirect users to cart after add to cart what steps i should follow to do that ? 
Thank you :)

0 Likes
Shopify Partner
1891 318 403

Hi @Fa_boua 

Its depend on your theme coding which code you have used? have you custom theme? You have to find where you have added ajax cart function added. if custom theme then you can find if option available in product page on theme editor. 

Send me store url

Want to modify or custom changes on store hire me.
If helpful then please Like and Accept Solution.
Email: jasoliyabrijesh123@gmail.com
Skype: jasoliya.brijesh
0 Likes
New Member
3 0 0

debut theme :)

0 Likes
New Member
3 0 0

Please help !!

0 Likes

Success.

Shopify Partner
1891 318 403

Find this code In asset->theme.js->find "$.post(params)".

If your theme contain this then follow this:

add location.href="/cart";

So it look like:

 

 $.post(params)
        .done(
          function(item) {
            this._hideErrorMessage();
            this._setupCartPopup(item);
             location.href="/cart";
          }.bind(this)
        )

 

 

 

Want to modify or custom changes on store hire me.
If helpful then please Like and Accept Solution.
Email: jasoliyabrijesh123@gmail.com
Skype: jasoliya.brijesh
3 Likes
Tourist
6 0 1

Thank you so much! This solved it for me!

0 Likes
Highlighted
New Member
8 0 0

I would actually want the opposite. On my Debut theme, the add to cart button takes me directly to the cart page and I want it to leave the customer where he is, no redirect no refresh, just a normal cart notification in the top right that his product was added there.

 

Can anyone help with this (I though I found something about this in the past but right now it seams to elude me).

0 Likes
Shopify Partner
1891 318 403

Hi @WMatthew 

If you are looking at above code in theme.js then no need to add this line.

location.href="/cart";

 replace with alert('Product added');

Want to modify or custom changes on store hire me.
If helpful then please Like and Accept Solution.
Email: jasoliyabrijesh123@gmail.com
Skype: jasoliya.brijesh
0 Likes