Search the Community
Showing results for tags 'hookactioncartsave'.
-
Hi all, we are trying to develop our first custom module on Prestashop 1.7. We need to execute some code lines just on Cart changes and we are using the hook hookactionCartSave(). All is working fine but we need to avoid to execute this code lines in the Checkout pages (i.e. we don't want to execute the code when somebody changes the Payment Method in the Checkout page). We are wondering if we can get the current state of the cart or something similar in the Cart page and in the Check out page... public function hookactionCartSave($params) { if (!Validate::isLoadedObject($this->context->cart) || !Validate::isLoadedObject($params['cart'])) { return false; } else { $cart_status = "current cart status... or something similar " if($cart_status == "cart-summary"){ // do something } else if($cart_status == "cart-checkout"){ // do Nothing } } } thank you for your help,
-
My client has a pricing engine that is a centralized system (this is using in many application ) which has the provision to add the discounts/coupons and their pricing engine has an API where we need to post the details of the products that is in the cart( as json request) and in response it calculates the discounts and provide the json response that has the details of the discounts (discount total, voucher code etc). Based on these response we have to apply the discounts to the cart (if any). The pricing engine's table also has the referencenumber which is unique and that is also same in the prestashop product table. So based on that only the pricing engine check whether there is discount or not. We are using prestashop 1.6 and started developing a module. We are planning to use the hookActionCartSave(). But the problem we are facing is that we don't know how to update the cart. We know that $cart->update() will update the cart. But not the pricing. How to apply the discounts and reprocess the cart? Please anyone have an idea?
-
Bonjour, Existe-il un hook du genre "hookActionCartBeforeSave" ? Je souhaite faire des traitements juste avant qu'un produit soit supprimé du panier. Le hook hookActionCartSave intervient après suppression du produit (et moi, j'ai besoin des informations du produit pour faire select value from customized_data where id_customization = ...)
-
Hi All, I have make a module to add one field in class cart. I have add the input in the form.tpl only for backoffice. Now I must get it in a hook (hookActionCartSave) but nothnig work. I have try Tools::getValue nothing, how to get this input text ? maye there an hidden hook ?? Thanks a lot,
- 1 reply
-
- adminorders
- addorder
-
(and 3 more)
Tagged with: