Jump to content

Ps 1.7 get cart status on hookactionCartSave

Recommended Posts

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, 

Share this post

Link to post
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...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More