Dallerdkj Posted May 19, 2014 Share Posted May 19, 2014 Hello I have a productaccessories module, that i just finished styling and then i realise that Add to cart dont work So my question is, what is the correct way to make it add product to cart. My products add to cart is js, so no URL to see (a simple html button). The Add to cart code looks like this: <a class="button_small exclusive_small ajax_add_to_cart_button" href="{$base_dir}cart.php?qty=1&id_product={$accessory.id_product|intval}&token={$static_token}&add" rel="ajax_id_product_{$accessory.id_product|intval}" title="{l s='Add to cart' mod='productaccessories'}">{l s='Add' mod='productaccessories'}</a> But this is not the correct way in PS 1.6? Link to comment Share on other sites More sharing options...
Dallerdkj Posted May 19, 2014 Author Share Posted May 19, 2014 I found a solution if anyone else needs to customize a 1.5 module - However it still does not show the "added to cart" popup on product page. As I can see, the 1.6 uses forms to do the add to cart function. <form action="{$link->getPageLink('cart')|escape:'html':'UTF-8'}?qty=1&id_product={$accessory.id_product|intval}&token={$static_token}&add" method="POST"> <input type="submit" class="button_small exclusive_small" value="{l s='Add' mod='productaccessories'}" /> </form> Now does anyone know how to invoke the popup page? Link to comment Share on other sites More sharing options...
vekia Posted May 19, 2014 Share Posted May 19, 2014 hello i've got question this modification adds product to cart "in background" or page reloads ? you've got ajax cart turned on? (option on block cart module configuration page) Link to comment Share on other sites More sharing options...
Recommended Posts