smithsh6 Posted April 22, 2014 Share Posted April 22, 2014 Since the add to cart function takes 15 seconds, I would like to show a message when add to cart is clicked.The message would say "Please wait while your product is being adding to cart. Product shipping information is being gathered from usps.com, ups.com, and fedex.com." Does anyone know how I could add a message that would show when the add to cart button is clicked? Link to comment Share on other sites More sharing options...
vekia Posted April 22, 2014 Share Posted April 22, 2014 15 seconds is definitely not default behaviour... check this: add to cart notification bar you can use this guide the only one thing you have to change, in guide i suggested to use code in success: function(jsonData,textStatus,jqXHR) { but you have to use it right after add : function(idProduct, idCombination, addedFromProductPage, callerElement, quantity, wishlist){ then notification will appear right after you press on "add to cart" button 2 Link to comment Share on other sites More sharing options...
smithsh6 Posted April 23, 2014 Author Share Posted April 23, 2014 I made the changes. I cleared the cache in the back office of Prestashop. I cleared the cache on my browser. Yet when I add an item to the cart, the confirmation does not display. Am I missing a step? Here's my code changes: /public_html/themes/PRS030057/header.tpl <script type="text/javascript"> var baseDir = '{$content_dir|addslashes}'; var baseUri = '{$base_uri|addslashes}'; var static_token = '{$static_token|addslashes}'; var token = '{$token|addslashes}'; var priceDisplayPrecision = {$priceDisplayPrecision*$currency->decimals}; var priceDisplayMethod = {$priceDisplay}; var roundMode = {$roundMode}; var addtocartconfirmation = '{l s='Product successfully added to cart'}'; </script> /public_html/modules/blockcart/ajax-cart.js // add a product in the cart via ajax add : function(idProduct, idCombination, addedFromProductPage, callerElement, quantity, wishlist){ $("body").append("<div class='addtocartconfirmation'><span>"+addtocartconfirmation+"</span></div>"); $(".addtocartconfirmation").fadeOut(8000); if (addedFromProductPage && !checkCustomizations()) { alert(fieldRequired); return ; } emptyCustomizations(); /public_html/themes/PRS030057/css/global.css .addtocartconfirmation { background: #D34F2B; display:block; position:fixed; bottom:0px; left:0px; text-align:center; padding:10px 0px; width:100%; z-index:99999; } .addtocartconfirmation span { color:#fff; text-shadow:1px 1px 0px #000; font-size:18px; font-weight:bold; } Link to comment Share on other sites More sharing options...
vekia Posted April 23, 2014 Share Posted April 23, 2014 can i verify your website? if so- please share url - i will inspect it. Link to comment Share on other sites More sharing options...
mysticpotion Posted May 13, 2014 Share Posted May 13, 2014 hi vekia, can you check my website? i am having the same problem. vaporfaction.com Link to comment Share on other sites More sharing options...
mysticpotion Posted May 13, 2014 Share Posted May 13, 2014 nevermind. it was because i had too many shipping options configured. disabled few of them now it is fast again. Link to comment Share on other sites More sharing options...
Markaus Posted August 20, 2014 Share Posted August 20, 2014 nevermind. it was because i had too many shipping options configured. disabled few of them now it is fast again. can i verify your website? if so- please share url - i will inspect it. having same problem, i would like to inform customer while the add to cart take time to add !! or any solution to make the add to cart work quick/load quick.. thanks Link to comment Share on other sites More sharing options...
Umar Akram Posted October 17, 2014 Share Posted October 17, 2014 15 seconds is definitely not default behaviour... check this: add to cart notification bar you can use this guide the only one thing you have to change, in guide i suggested to use code in success: function(jsonData,textStatus,jqXHR) { but you have to use it right after add : function(idProduct, idCombination, addedFromProductPage, callerElement, quantity, wishlist){ then notification will appear right after you press on "add to cart" button Add to cart product take 10-15 seconds. which is bad. Any have idea about that issue.? Link to comment Share on other sites More sharing options...
Vieriu Posted November 7, 2014 Share Posted November 7, 2014 (edited) Thank you Mr. Vekia, great tutorial and it work great on PrestaShop 1.5.6.2 Edited November 7, 2014 by Vieriu (see edit history) 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