any help identifying the error will be highly appreciated.
on magento admin I getting the following error message when trying to access the payment methods. "Fatal error: Call to a member function isSandbox() on a non-object in Block/System/Config/Forms/Checkbox.php on line 13"
Here is the code for Checkbox.php:
class Paguelofacil_Pagocash_Block_System_Config_Forms_Checkbox extends Mage_Adminhtml_Block_System_Config_Form_Field
{
protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
{
$cvalue = Mage::getModel('Gateway/Config_Settings')->isSandbox();
$checkActive = (Mage::getModel('Gateway/Config_Settings')->isSandbox()==1)?'checked':'';
$html = "
<input type='hidden' value='".$cvalue."' id='payment_Pagocash_sandbox' name='groups[Gateway][fields][sandbox][value]'>
<input type='checkbox' class='select' onclick='pagueloFacilChange(this)' ".$checkActive."> Habilitado PagoCash Sandbox
<script type='text/javascript'>
function pfpagoCashChange(currentElement)
{
document.getElementById('payment_Pagocash_sandbox').value = (currentElement.checked)?1:0;
}
</script>
";
//}
return $html;
}
}
1 Answer 1
The method Mage::getModel('Gateway/Config_Settings') is returning null, meaning that Magento cannot resolve Gateway/Config_Settings to a Magento model.
Now it's been a while since I've worked with Magento 1, but my best guess is that your configuration path is incorrect (don't know if it's case-sensitive, so you could try gateway/config_settings, or that there is no such class in the module that is providing the gateway-namespace (typical path should be Vendor/Module/Model/Config/Settings.php).
Explore related questions
See similar questions with these tags.
Mage::getModel('Gateway/Config_Settings')is not part of magento core. Please post config.xml of the related module.