kronos88 Posted October 1, 2022 Share Posted October 1, 2022 Hello, i've got a strange behavior and don't now where the cause is. I override the CartController class from /controllers/front/CartController.php This modified class i've got in my module under /override/controllers/front/CartController.php and also copied to /override/controllers/front/CartController.php My code simply looks like this: class CartController extends CartControllerCore { public function processChangeProductInCart() { $query = 'INSERT INTO `ps_customized_data` (`id_customization`, `type`, `index`, `price`, `value`) VALUES (' . 1 . ', ' . 1 . ', ' . 2 . ', ' . 3 . ', \'Tedst\')'; Db::getInstance()->execute($query); parent::processChangeProductInCart(); } } It should only write a new entry in ps_customized_data (for testing). But if i add a product into cart, the entry will not be writte to the database. So if i add this code snipped to the real CartController and add new product to cart, the entry will be written to database. What i'm doing wrong? I'm using no cache, all overrides in settings are active. Thanks for all your help. Tobias Link to comment Share on other sites More sharing options...
lordignus Posted October 4, 2022 Share Posted October 4, 2022 Have you deleted/regenerated the class index? Link to comment Share on other sites More sharing options...
kronos88 Posted October 4, 2022 Author Share Posted October 4, 2022 vor 20 Minuten schrieb lordignus: Have you deleted/regenerated the class index? Yes, and thats the input of this file: Link to comment Share on other sites More sharing options...
musicmaster Posted October 5, 2022 Share Posted October 5, 2022 Testing can be done by just echoing some string too. Did you check whether the things that you do call this function processChangeProductInCart()at all? Sometimes code works a bit differently than you would expect. It is also possible that this part of the code has been replaced with Symfony based code. Try activating Profiling to see from where relevant queries are called. 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