Jump to content

Fatal error when add product into cart in PS versions 1.7.8.0 and above.


Gouravdev
 Share

Recommended Posts

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 :)

Share this post


Link to post
Share on other sites

  • 2 months later...
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. 

Share this post


Link to post
Share on other sites

 

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?

Share this post


Link to post
Share on other sites

    /**
     * @param array $params
     */
    public function hookActionCartSave($params)
    {
        if (!Validate::isLoadedObject($this->context->cart) || !Validate::isLoadedObject($params['cart'])) {
            return;

inside the hook

Share this post


Link to post
Share on other sites

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 :)

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
 Share

×
×
  • Create New...

Important Information

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