Jump to content

Add to cart on old 1.5 module -> What's the correct way in 1.6?


Recommended Posts

Hello

 

I have a productaccessories module, that i just finished styling and then i realise that Add to cart dont work :D

 

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

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

×
×
  • Create New...