Alvaro Tarela 7 Posted December 9, 2020 Posted December 9, 2020 I need to do additional actions when the cart is changed. I need to read the content of the cart and then check a set of conditions. So, I need to know how to put my set of conditions (a function). I want to print an error in the cart summary so I need my function to be executed when a product is changed (add or remove) in that screen. Can I use a module and put my function on it? This not work for me: public function hookActionCartSave(){ return $this->checkMyCart(); } protected function checkMyCart(){ // My code gos here.. $this->errors[] = $this->trans( $my_error_msg, array(), 'Shop.Notifications.Error' ); } Share this post Link to post Share on other sites
ndiaga 347 Posted December 10, 2020 Posted December 10, 2020 Hi, Create a new module and implement your code inside it. The conditions will take effect since you are calling the right hook. Share this post Link to post Share on other sites
Alvaro Tarela 7 Posted December 10, 2020 Posted December 10, 2020 It doesn't work... I generate an "alert()" and nothing occurs... Only when I load the page, but nothing when I change a product quantity in the cart. Share this post Link to post Share on other sites
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