[Express Theme] How to redirect Add To Cart to Cart Page

Jack2021
New Member
6 0 0

Hi

Thanks for taking you time to helping out.

 

I am trying to figure out Express Theme cause its fast and light but man its so hard to make any good customization. Anyway all I want is when people click "Add To Cart" in product page I want it to go to cart page instead of showing  "Product added to your cart. View Cart" on the product page:

Jack2021_0-1602224273033.png

I feel like solution is similar to what Jasoliya posted for another theme but can't figure the code out for Express theme.

Jack2021_1-1602224374269.png

 

My store currently using another theme so I cant share the store but below is the theme.js for express theme full code:

https://codeshare.io/2Kl698

 

Thanks for your kind help.

 

Replies 5 (5)
JohnFromJotting
Shopify Partner
665 94 128

Hi Jack,

Hopefully this would be easy, go to your theme.js file. Comment out the Ajaxcart.

Check out my blog for some awesome Shopify, SEO and Social Media Marketing content.


To hire me, visit my Upwork profile

Jack2021
New Member
6 0 0

Thanks for the reply. Seems not way to find the right spot for ajax. 

I found a temp work around, hope one day I can fix it because the theme is lighting fast lol 

JohnFromJotting
Shopify Partner
665 94 128

Sorry replied to wrong post, and glad you found a temp workaround 🙂

Check out my blog for some awesome Shopify, SEO and Social Media Marketing content.


To hire me, visit my Upwork profile

basvrooijen
New Member
1 0 0

Hi Jack what workaround did you use? I've been running into a similar problem, want to redirect to cart page in order to display date picker. Would greatly appreciate your help!!

mozunk
New Member
2 0 0

For Express theme, this is a little tricky and I couldn't get it to work with "quick cart" enabled.

In theme.js line 2236, update _productAddedToCart()  to include 

 

location.href"/cart";

 

 

It should look roughly like this:

 

_productAddedToCart() {
if (!this.scrolledPastHeader) return;
if (!this.isFixed) {
if (this.isHeaderAnimating) {
setTimeout(() => {
this._headerSlideIn();
}, 500);

return;
}
this._headerSlideIn();
}
clearTimeout(this.stickyHeaderTimeout);
this.stickyHeaderTimeout = setTimeout(() => {
this._headerSlideOut();
}, 5000);
location.href"/cart";
},

As this file is minified, you'll need to copy the entirety of theme.js, minify it (or not), and update theme.min.js, too.