Jump to content

Change price by adding product to cart


max-kaktus

Recommended Posts

Hello,

 

I've created a little Prestashop module. With this module you can customize a product.

When adding the product to the cart with this code

<a class="exclusive ajax_add_to_cart_button" rel="ajax_id_product_{$product.id_product}"
href="{$link->getPageLink('cart')}?qty=1&id_product={$product.id_product}&
token={$static_token}&add" title="{l s='Add to cart' mod='folienplotter'}">
{l s='Add to cart' mod='folienplotter'}
</a>

 

the calculated price should be passed to the product. I don't know how to manage this.

Thanks for helping me!

Link to comment
Share on other sites

Complicated, very hard to explain.
You need to ad your code to the "add" method of ajax-cart.js.
Pass it to the ajax function, then include any necessary calculation in the cart. You need to store it, so you will need an extra column in ps_cart_product and extra code in Cart::getProducts too. Long and complex

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...