Gouravdev Posted January 15, 2022 Share Posted January 15, 2022 Hi Team, Recently, we've encountered an issue when the product is added to the cart. When we call $cart->getProducts(); this leads to a fatal error and 500 response on the front-end. NO issue encountered for version below 1.7.8.0. Recording: https://beta.claap.io/sendinblue/fatal-error-c-3YfMIiN6mG-AL7OcMGtoJMg Can you please have a look at the issue is coming after PS updated to 1.7.8.0 and above. -> `ActionCartSave` called -> Under `handleEvent($cart)` , $cart->getProducts(); leads to an fatal error. Please help with this case, thanks in advance Link to comment Share on other sites More sharing options...
abdullacm Posted March 15, 2022 Share Posted March 15, 2022 Hi @Gouravdev were you able to fix this issue ? Link to comment Share on other sites More sharing options...
Gouravdev Posted March 15, 2022 Author Share Posted March 15, 2022 13 minutes ago, Abdulla CM said: Hi @Gouravdev were you able to fix this issue ? Yes, I fixed it. Link to comment Share on other sites More sharing options...
abdullacm Posted March 15, 2022 Share Posted March 15, 2022 16 minutes ago, Gouravdev said: Yes, I fixed it. Great, Could you please share the fix, will be very helpful. Thanks, Link to comment Share on other sites More sharing options...
Gouravdev Posted March 15, 2022 Author Share Posted March 15, 2022 Actually the hook runs twice, first with null value and then with the product values. Link to comment Share on other sites More sharing options...
abdullacm Posted March 15, 2022 Share Posted March 15, 2022 called twice from prestashop core or something with hook registration by corresponding module ? Link to comment Share on other sites More sharing options...
Gouravdev Posted March 15, 2022 Author Share Posted March 15, 2022 Like you need the fix related to the Sendinblue module? Link to comment Share on other sites More sharing options...
abdullacm Posted March 15, 2022 Share Posted March 15, 2022 2 minutes ago, Gouravdev said: Like you need the fix related to the Sendinblue module? i have 3 modules to fix the same issue, upgraded a site with 3 modules using same hook. Link to comment Share on other sites More sharing options...
abdullacm Posted March 15, 2022 Share Posted March 15, 2022 18 minutes ago, Gouravdev said: Actually the hook runs twice, first with null value and then with the product values. can you share the fix you did or the module as zip? Link to comment Share on other sites More sharing options...
Gouravdev Posted March 15, 2022 Author Share Posted March 15, 2022 /** * @param array $params */ public function hookActionCartSave($params) { if (!Validate::isLoadedObject($this->context->cart) || !Validate::isLoadedObject($params['cart'])) { return; inside the hook Link to comment Share on other sites More sharing options...
abdullacm Posted March 15, 2022 Share Posted March 15, 2022 2 hours ago, Gouravdev said: /** * @param array $params */ public function hookActionCartSave($params) { if (!Validate::isLoadedObject($this->context->cart) || !Validate::isLoadedObject($params['cart'])) { return; inside the hook yes, thanks a lot. it works perfectly Link to comment Share on other sites More sharing options...
Gouravdev Posted March 16, 2022 Author Share Posted March 16, 2022 15 hours ago, Abdulla CM said: yes, thanks a lot. it works perfectly cool 😎 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