$_helper = $this->helper('catalog/output');
i received this error on browser when I run the code.
Using $this when not in object context in
What should i do for this .
Magento Stack Exchange is a question and answer site for users of the Magento e-Commerce platform. It only takes a minute to sign up.Sign up to join this community
you should have this:
require_once('app/Mage.php'); $app = Mage::app(); Mage::helper('catalog/output');
Basically the $this->helper is calling the function that is contained inside the current template's block class. The Mage::helper is calling the function in the "God" class.
The $this->helper normally calls a function in the class Mage_Core_Block_Abstract which checks the layout for a helper and then simply calls the normal Mage::helper if it cannot find one.
I think you are creating a stand alone script.
so you can try below things to work
require_once("$Magento_Root_DIR/app/Mage.php"); // include Mage.php file $app = Mage::app(); //init Mage::app() $_helper = Mage::helper('catalog/output'); //calling helper class