jumbo Posted December 14, 2011 Share Posted December 14, 2011 Hi all I need to disable the ajax animation on the product page. When the user clicks on Add to cart, I want them to be taken to the cart page directly. No animation needed. The current link code for the add to cart "button" is: <a class="exclusive" href="javascript:document.getElementById('add2cartbtn').click();">{l s='Add to cart'}</a> Obviously, I will need to replace the javascript part by something else. Can anyone help? thanx Link to comment Share on other sites More sharing options...
Dave L Posted December 14, 2011 Share Posted December 14, 2011 You don't need to replace any code or javascript. Modules>Front office features>Cart block - configure and disable AJAX mode. Preferences>Products - Re-direction after adding product to cart set to cart summary. Now when Add to Cart is clicked your customer will be taken to the cart page directly. 2 Link to comment Share on other sites More sharing options...
jumbo Posted December 19, 2011 Author Share Posted December 19, 2011 You don't need to replace any code or javascript. Modules>Front office features>Cart block - configure and disable AJAX mode. Preferences>Products - Re-direction after adding product to cart set to cart summary. Now when Add to Cart is clicked your customer will be taken to the cart page directly. hi Dave, and thank you for your help however, my settings are already as you described but the animation still works on the product page... Link to comment Share on other sites More sharing options...
jumbo Posted December 19, 2011 Author Share Posted December 19, 2011 it may be something relating to the theme I installed i'm gonna try to work it out, but if anyone has an answer, please advise thanx Link to comment Share on other sites More sharing options...
jumbo Posted December 19, 2011 Author Share Posted December 19, 2011 When I replace the code I gave above for the add to cart button, with the code show below, I get redirected to the shopping cart page without any animation, however the variation (combination) I select is not replicated. The default variation of the product is added to the cart <a class="exclusive button ajax_add_to_cart_button" href="{$link->getPageLink('cart.php')}?qty=1&id_product={$product->id|intval}&token={$static_token}&add" rel="ajax_id_product_{$product->id|intval}" title="{l s='Add to cart'}">{l s='Add to cart'}</a> Link to comment Share on other sites More sharing options...
jumbo Posted December 21, 2011 Author Share Posted December 21, 2011 no one else has any idea about this? it should be trivial in prestashop to have a non-ajax add to cart button Link to comment Share on other sites More sharing options...
FranciscoVillen Posted January 16, 2013 Share Posted January 16, 2013 hello, I have the same problem, my settings are correct: Modules>Front office features>Cart block> disabled AJAX mode and disabled AJAX in block top cart module. Preferences>Products - Re-direction after adding product to cart set to cart summary. But the redirection doesn't work, I use prestashop 1.4 with the theme Blackwhite. I have the block top cart module in the hook Top, when I remove this module from this hook, the redirection works but I need the block top cart in that hook. I think the problem is that the ajax effect isn't being disabled although the settings are correct. Any ideas? how can I solve this? Link to comment Share on other sites More sharing options...
hobylazy Posted February 7, 2013 Share Posted February 7, 2013 Disabling ajax cart will only works for product pages, did not work for product list pages. In product list when you add to cart, it turns to a fresh cart summary page, but no product added, it says "cart is empty". There should be add some coding at the product-list.tpl for add to cart form. The following is add to cart form in product-list.tpl {if isset($static_token)} <a class="button ajax_add_to_cart_button exclusive" rel="ajax_id_product_{$product.id_product|intval}" href="{$link->getPageLink('cart',false, NULL, "add&id_product={$product.id_product|intval}&token={$static_token}", true)}" title="{l s='Add to cart'}"><span></span>{l s='Add to Cart'}</a> {else} <a class="button ajax_add_to_cart_button exclusive" rel="ajax_id_product_{$product.id_product|intval}" href="{$link->getPageLink('cart',false, NULL, "add&id_product={$product.id_product|intval}", true)} title="{l s='Add to cart'}"><span></span>{l s='Shop now'}</a> {/if} {else} <span class="exclusive"><span></span>{l s='Add to cart'}</span><br /> {/if} How to make it directly check out at product list pages? Link to comment Share on other sites More sharing options...
امیر Posted June 11, 2017 Share Posted June 11, 2017 i need this code for site i will display ajax add to cart for moudle relate prouductdemo : http://puzel.ir/2084-price-list-samsung-galaxy-j7-prime-mobile-phone plz see image : Link to comment Share on other sites More sharing options...
Recommended Posts