Jump to content

Additional actions when the cart is changed.


Alvaro Tarela

Recommended Posts

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'
            );
}

 

 

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...