akps1234 Posted October 22, 2015 Share Posted October 22, 2015 Hi, I'm looking for help in solving a problem with the Ajax shoping cart in the "Quick VIew" window. Prestashop version 1.6.1.1 The cart works fine when the "Add to Cart" button pressed from the Product page or Home page of the web site. However, when I press "Add to Cart" button in the "Quick View" window of the product, it doesn't display a pop-up window with the message "Product succesfully added to your Shopping Cart" and two buttons "Continue Shopping" and "Proceed to Checkout" Instead, it displays the "Summary" page of the Shopping Cart in the same "Quick View" window (the same width but taller). I noticed that CSS code attached to the correctly working "Add to Cart" button: <button class="exclusive" name="Submit" type="submit"></button> in the Product page has a portion of ajax-cart.js file attached to it like this: function(e) { e.preventDefault(); ajaxCart.add($('#product_page_product_id').val(), $('#idCombination').val(), true, null, $('#quantity_wanted').val(), null);} The same "Add to Cart" button in the "Quick View" window doesn't have this .js node. I made some changes to the CSS code of the "Quick View" window page and added the Payment Logos module to it with the custom image in the same format as original But I didn't touch the .tpi or .php files. Thank you. Alex Link to comment Share on other sites More sharing options...
akps1234 Posted October 23, 2015 Author Share Posted October 23, 2015 Problem solved! There was a minor change in the product.tpl file that caused the ajax-cart.js not working properly in the Quick-View window. Restoring to the default product.tpl file fixed the issue Link to comment Share on other sites More sharing options...
pirouzmm Posted November 22, 2015 Share Posted November 22, 2015 (edited) I had the same problem. Restoring the default product.tpl file did not work. The solution was to edit the ajax-cart.js as described below. Edit the ajax-cart.js file ('your theme' > js > modules > blockcart. Around line 141 where it reads for product page 'add' button... comment the if out. The result should look like this: //for product page 'add' button...// if ($('.cart_block').length) { $(document).off('click', '#add_to_cart button').on('click', '#add_to_cart button', function(e){ e.preventDefault(); ajaxCart.add($('#product_page_product_id').val(), $('#idCombination').val(), true, null, $('#quantity_wanted').val(), null); });// } Worked for me. Edited November 22, 2015 by pirouzmm (see edit history) 1 Link to comment Share on other sites More sharing options...
pradeepmehtarec Posted November 26, 2015 Share Posted November 26, 2015 I had the same problem. Restoring the default product.tpl file did not work. The solution was to edit the ajax-cart.js as described below. Edit the ajax-cart.js file ('your theme' > js > modules > blockcart. Around line 141 where it reads for product page 'add' button... comment the if out. The result should look like this: //for product page 'add' button... // if ($('.cart_block').length) { $(document).off('click', '#add_to_cart button').on('click', '#add_to_cart button', function(e){ e.preventDefault(); ajaxCart.add($('#product_page_product_id').val(), $('#idCombination').val(), true, null, $('#quantity_wanted').val(), null); }); // } Worked for me. Love you bro... It worked. I searched at so many places, but no luck. Thanks a lot. but I am surprised how come such a basic bug is still there in prestasho (i am using 1.1.6.2) Link to comment Share on other sites More sharing options...
mikaelhultkvist Posted February 18, 2016 Share Posted February 18, 2016 Thank you @ pirouzmm! You saved me from ripping my hair off! 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