themreviil Posted February 5, 2023 Share Posted February 5, 2023 Hi, I'm writing module to configuration product and when client choose all what he needs click add to cart. But i must change price this product. I tring change element in form with price but don't work and I was using special price and fucntion applyRuleToProduct(); but in wasn't good. because special price is for time or for product. Thanks for help Link to comment Share on other sites More sharing options...
themreviil Posted March 12, 2023 Author Share Posted March 12, 2023 I found solution to this. I created extra table with my new price product and insert this after click "Add to cart" button. Next step in Product.php in methihod priceCalculation(). after // Customization price if ((int) $id_customization) { $price += Tools::convertPrice(Customization::getCustomizationPrice($id_customization), $id_currency); } I insert my code with get currently price my product. $price = Db::getInstance()->getValue('SELECT price FROM `' . _DB_PREFIX_ . 'my_new_prod_price` WHERE `user_id`='.$user_id.' OR `user_id`='.Context::getContext()->cookie->id_guest.' AND `product_id`='.$id_product.' AND `cart_id`='.$id_cart.';'); PROBLEM SOLVED Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now