1

I have a facade 'CustomMage', but from which I'm not able to include magento api.

<?php namespace Bond\CustomMage;

class CustomMage {

    /* Using mage configurations*/
    public static function changeIsActive($table, $id, $status){  
        $api_path = \Config::get('api.mage_soap_api_path');
        require_once("{$api_path}app/Mage.php");

        /*umask(0);
        Mage::app('default');
        $quote = Mage::getModel('sales/quote')->load($id);
        $quote->setIsActive($status)->save();*/
    }   

}

I'm getting this error,

[2018-02-07 08:47:09] local.ERROR: exception 'ErrorException' with message 'include(Bond\CustomMage\Mage.php): failed to open stream: No such file or directory' in /var/www/html/FootballTicketPad/ecomm/lib/Varien/Autoload.php:93

But this code is ok if i use it in app/helpers.php.

function GetModal($table, $id){ 
    $api_path = \Config::get('api.mage_soap_api_path');
    require_once("{$api_path}app/Mage.php");
    umask(0);
    Mage::app('default');       
    return Mage::getModel($table)->load($id);
}
Geethu
  • 348
  • 6
  • 24

0 Answers0