Jump to content

Help, Error getProducts() on a non-object in CartRule.php


Recommended Posts

Hello,

Im having a small issue when I'm trying to add a manual order to a customer from the back end. When I press the button to place the order to the user I'm getting this error message
 

Fatal error: Call to a member function getProducts() on a non-object in /public_html/classes/CartRule.php on line 634

I have 1.6.0.8

 

I found this link but i dont have the follow up module install

How i can solve it? Thank you

Edited by giwrgos (see edit history)
Link to comment
Share on other sites

Same problem here.

 

I  was planning and testing the upgrade from 1.5.4 to 1.6.0.6

 

Yesterday, i did the final upgrade to 1.6.0.8

 

The problem is with PDF generator. The invoices are not generated due to the fatal error

Fatal error: Call to a member function getProducts() on a non-object in /var/www/vhosts/proteinexpress.jp/httpdocs/classes/CartRule.php on line 634

 

 

The version 1.6.0.6 have no problem.

Link to comment
Share on other sites

I could solved temporarily...

 

 

The problem may be here

 

file: classes/CartRule.php

line: 308

$r = $cr->checkProductRestrictions(Context::getContext(), false, false);

I tried to

$r = $cr->checkProductRestrictions($this->context, false, false);

but, $this->context not available inside this class..

 

 

Then, my solution was to replace with the file from 1.6.0.6 (click to see the code)

All working fine, but i don't know if may cause others problems..
 

 

Hope for solutions from experts or upgrades to fix.

Edited by omine (see edit history)
  • Like 2
Link to comment
Share on other sites

I could solved temporarily...

 

 

The problem may be here

 

file: classes/CartRule.php

line: 308

$r = $cr->checkProductRestrictions(Context::getContext(), false, false);

I tried to

$r = $cr->checkProductRestrictions($this->context, false, false);

but, $this->context not available inside this class..

 

 

Then, my solution was to replace with the file from 1.6.0.6 (click to see the code)

All working fine, but i don't know if may cause others problems..

 

 

Hope for solutions from experts or upgrades to fix.

Same problem. Reverting to 1.6.0.6 file did the trick! Thanks for the solution. I hope this will be included in next release.

Link to comment
Share on other sites

I could solved temporarily...

 

 

The problem may be here

 

file: classes/CartRule.php

line: 308

$r = $cr->checkProductRestrictions(Context::getContext(), false, false);

I tried to

$r = $cr->checkProductRestrictions($this->context, false, false);

but, $this->context not available inside this class..

 

 

Then, my solution was to replace with the file from 1.6.0.6 (click to see the code)

All working fine, but i don't know if may cause others problems..

 

 

Hope for solutions from experts or upgrades to fix.

 

 

thank you for your reply. Reverting to 1.6.0.6 file did the trick!! Thanks for your solution, I hope the team see this post and fix the issue on the next update

Link to comment
Share on other sites

  • 4 weeks later...
×
×
  • Create New...