Stay on the product page after adding products to the cart - Debut Theme

Highlighted
New Member
2 0 0

Hello everyone! 

 

I have been following this guide: https://community.shopify.com/c/Shopify-Design/Product-pages-Stay-on-the-product-page-after-adding-p... -- to try and get the Debut theme on a site to no longer re-direct to the cart once a product is added. 

I have checked, re-checked and on a fresh install of the Debut theme and I am just not able to get it working! I have tested various methods from the other forum posts as well and none worked..


Is anyone able to provide some insight in what I am missing here? 

 

Site URL: https://little-babes-bows.myshopify.com/ 

0 Likes
Highlighted
Shopify Expert
2901 497 665

HI @GabbyG 

You have used app to show extra field next to variant that change base on variant selection so need to pass this selection also in cart. 

You can follow this but cant say fully work with your app code:

1. Section->product-template.liquid and find name="add" and change type="submit" to type="button"

2. Add this Js code in Asset->theme.js at bottom:

 

 $(document).on('click','.product-form__cart-submit',function(){
$.ajax({
type: 'POST',
url: '/cart/add.js',
data: jQuery('[action="/cart/add"]').serialize(),
dataType: 'json',
success: function (data) {
//done
}
});
});

 

 

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
Want to get Free review and advice for sale on store ?? just text me here
0 Likes
Highlighted
Tourist
5 0 0

Hey @Jasoliya -- I will reply from this account rather than my wife's! :D 

 

Thanks for the response. Viewing my product.liquid file, I have trouble following " find name="add" and change type="submit" to type="button"" 

 

it seems that I cannot locate anything that resembles that bit of code. Any insight would be greatly appeciared here. 

 

Thank you again for looking over this one. 

0 Likes
Highlighted
Shopify Expert
2901 497 665

If you have not name="add" or name='add' in template->product.liquid then find in section->product.liquid or section->product-template.liquid file

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
Want to get Free review and advice for sale on store ?? just text me here
0 Likes
Tourist
5 0 0

Thanks for the clarification there! I adjusted that and added the suggested code but it still seems to just be re-directing to the cart section after adding a product to the cart from the product page. 

 

Thanks for the insight though, it was worth a shot! 

0 Likes
Highlighted
Shopify Expert
2901 497 665

As i can see you have not changes my given code and attribute till, also you have added other documents code for stay on page, so you have to go with any one code because as i can see you have generating Js error on your current  page right now so you have to solve it and this error is from your added code for ajax function. 

issue.PNG

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
Want to get Free review and advice for sale on store ?? just text me here
0 Likes
Highlighted
Tourist
5 0 0

I did try just your code, but it had the same affect. So I tried the previous method again. It has since been disabled.


I’m not fully sure what you mean. I can see the changes you advised made on the appropriate sections. 

Are you able to see them now? I can reach out via email if that’s better for you I’d you’d like. 

0 Likes
Highlighted
Shopify Expert
2901 497 665

sure text em on mail or Skype

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
Want to get Free review and advice for sale on store ?? just text me here
0 Likes