I am facing an issue with $this in a code of extension. Looks like PHP version issue. In one server all working fine and in another server it is not working & giving error like this :-
Fatal error: Uncaught Error: Using $this when not in object context in filename.php on line no. 12
The code on line no.12 is :
if (!$this->getConditions())
{
return true;
}
If I comment this code then error comes on another line where there is $this.
The server where everything is working fine, it's PHP version is : 5.3 The server where error is coming, it's PHP version is : 7.0
I guess this PHP version may be the issue but can anyone please tell the solution for this? or there is no way except changing the PHP version?
EDIT: scope:
class Namespace_Module_Model_SalesRule_Rule_Condition_Product_Combine
extends Mage_SalesRule_Model_Rule_Condition_Product_Combine
{
public function validate(Varien_Object $object)
{
if (!$this->getConditions()) {
return true;
}
// ..... other code....
}
}