fashionmart Posted July 23, 2017 Share Posted July 23, 2017 Hi, I want to disable the Ajax cart popup that shows up after a customer clicks "Add to cart" and instead redirect them to the cart summary page. I have seen many posts instructing to disable Ajax add to cart in the Cart Block module, but this only works for 1.6. I have not seen this module or setting in Prestashop 1.7. Has anybody seen this setting in 1.7? Thanks Link to comment Share on other sites More sharing options...
vekia Posted July 23, 2017 Share Posted July 23, 2017 it's a 'shopping cart' module and it has option to enable or disable "ajax cart" "ajax cart" option - when disabled - does not show the "add to cart" confirmation popup 2 Link to comment Share on other sites More sharing options...
fashionmart Posted July 23, 2017 Author Share Posted July 23, 2017 Hi Vekia, Thank you for your quick response. Yes, that works great to disable the Ajax popup. But then, also, how do you redirect the customer to the Cart summary page after they click "add to cart"? In 1.6 the option was under Preferences > Product, "Redirect after adding product to cart" but there is no option like that in 1.7, or maybe I'm overlooking it. Would I have to add code manually? Thanks Link to comment Share on other sites More sharing options...
vekia Posted July 23, 2017 Share Posted July 23, 2017 in this case you have to re-enable the ajax cart You have to alter the js file of the module. it is because whole add to cart process is handled by core file of themes, it will be hard to change it. So it is better to edit ps_shoppingcart.js file here is the tutorial that i wrote exclusively for this topic: disable ajax cart popup modal window 1 Link to comment Share on other sites More sharing options...
Web Curator Posted September 27, 2017 Share Posted September 27, 2017 I know that I'm a little bit out of topic, but somebody knows which file I have to modify If I want to change the content of the pop up? PS 1.7 Link to comment Share on other sites More sharing options...
LaVallDesign Posted November 8, 2017 Share Posted November 8, 2017 On 23/7/2017 at 8:31 AM, vekia said: in this case you have to re-enable the ajax cart You have to alter the js file of the module. it is because whole add to cart process is handled by core file of themes, it will be hard to change it. So it is better to edit ps_shoppingcart.js file here is the tutorial that i wrote exclusively for this topic: disable ajax cart popup modal window I've tried it as you explain in the tutorial. But the redirection leads to the homepage, not the cart page. Is the variable "prestashop.urls.pages.cart" correct? $.post(refreshURL, requestData).then(function (resp) { $('.blockcart').replaceWith($(resp.preview).find('.blockcart')); if (resp.modal) { //showModal(resp.modal); window.location.replace(prestashop.urls.pages.cart); } }).fail(function (resp) { prestashop.emit('handleError', {eventType: 'updateShoppingCart', resp: resp}); }); Link to comment Share on other sites More sharing options...
De Verzamelman Posted November 22, 2017 Share Posted November 22, 2017 Op 23-7-2017 om 8:31 AM, vekia zei: in this case you have to re-enable the ajax cart You have to alter the js file of the module. it is because whole add to cart process is handled by core file of themes, it will be hard to change it. So it is better to edit ps_shoppingcart.js file here is the tutorial that i wrote exclusively for this topic: disable ajax cart popup modal window Have you already found a solution to the problem of redirected to the home page when logged in?? Link to comment Share on other sites More sharing options...
PrestaSOO Posted March 17, 2018 Share Posted March 17, 2018 i wrote an article here to show you How to disable Prestashop Add to Cart Popup without disable Ajax Cart. Hope this helps. Link to comment Share on other sites More sharing options...
Himanshubishtt Posted May 17, 2019 Share Posted May 17, 2019 Instead of this: window.location.replace(prestashop.urls.pages.cart); because it'll work only when you're not logged in. If you're logged in then it'll redirect you to the homepage. Change to this : window.location.replace('/en/cart?action=show'); if you have only one language. or default language English then remove /en. Hope it help 3 Link to comment Share on other sites More sharing options...
kreatywneprojektowan Posted October 26, 2019 Share Posted October 26, 2019 On 5/17/2019 at 1:45 PM, Himanshubishtt said: Instead of this: window.location.replace(prestashop.urls.pages.cart); because it'll work only when you're not logged in. If you're logged in then it'll redirect you to the homepage. Change to this : window.location.replace('/en/cart?action=show'); if you have only one language. or default language English then remove /en. Hope it help Thank you for your help! This code you write about works correctly for logged in users and store guests. Link to comment Share on other sites More sharing options...
ballashop Posted October 26, 2021 Share Posted October 26, 2021 Hi, I followed the directions but nothing happens. I have cleared both the browser and PrestaShop cache. Nothing happens, the popup continues to appear once the product has been placed in the basket. Any suggestions? Link to comment Share on other sites More sharing options...
photinia Posted July 31, 2022 Share Posted July 31, 2022 On 5/17/2019 at 2:45 PM, Himanshubishtt said: Instead of this: window.location.replace(prestashop.urls.pages.cart); because it'll work only when you're not logged in. If you're logged in then it'll redirect you to the homepage. Change to this : window.location.replace('/en/cart?action=show'); if you have only one language. or default language English then remove /en. Hope it help Before I used the @PrestaSOO desision. But after upgad to 1.7.8.7 it stopped working. (( So I took your code and all work properly - Loggin, not loggin, homepage or product page. Thank you! Link to comment Share on other sites More sharing options...
matogroup Posted August 29, 2023 Share Posted August 29, 2023 Hello You can also edit the html file related to the popup from the path below and keep the required sections or hide these codes altogether. [your-website]/themes/classic/modules/ps_shoppingcart/modal.tpl Link to comment Share on other sites More sharing options...
PrestaQvisten Posted September 21 Share Posted September 21 On 8/29/2023 at 10:49 AM, matogroup said: Hello You can also edit the html file related to the popup from the path below and keep the required sections or hide these codes altogether. [your-website]/themes/classic/modules/ps_shoppingcart/modal.tpl On 7/23/2017 at 8:31 AM, vekia said: in this case you have to re-enable the ajax cart You have to alter the js file of the module. it is because whole add to cart process is handled by core file of themes, it will be hard to change it. So it is better to edit ps_shoppingcart.js file here is the tutorial that i wrote exclusively for this topic: disable ajax cart popup modal window Hi! is it the same solution for Prestahop version 8.1.7? I want to disable the popup but want to show the the cart on the right side. Some prestashop installation it "slides out". Do you understand what i mean? See attached image. That slide out. Link to comment Share on other sites More sharing options...
ps8modules Posted September 26 Share Posted September 26 Hi. It makes more sense than a flyout window or a modal window to create a fly effect. Clicking the "Add to cart" button creates a thumbnail of the product that is added to the cart and flies up to the cart icon. Then the page scrolls up for the customer to see if the product has been added to the cart. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now