Quote Originally Posted by norber View Post
I found checking https://www.zen-cart.com/wiki/index.... wikitutorials that the order of loading is done by the array order.

$autoLoadConfig[0][]
in this case, [0] marks the order.

I checked that order in config.mobile.php and its 0

$autoLoadConfig[0][] = array('autoType'=>'class', 'loadFile'=>'Mobile_Detect.php');

and in case of config.fec.php its pretty big (90)

$autoLoadConfig[90][] = array('autoType'=>'class', 'loadFile'=>'observers/class.fec.php');

So config.fec.php is loaded way after mobile.

The problem is when its run.
I think i solved it!
FEC autotype is "classInstantiate"

And now i know that config.mobile is loaded BEFORE fec config since config.mobile array order is 0 and config.fec is 90.
The problem is "when" it runs. And i found that it does that inside that foreach in autoload_func.php. That the actions to run is defined in a switch case.

So i looked for case 'classInstantiate' (around line 128):


Code:
      case 'classInstantiate':
      $objectName = $entry['objectName'];
      $className = $entry['className'];
and then i added this

Code:
//if its a phone and object name = FECObserver  and class name=FECObserver ignore it
if (($deviceType=="phone") && ($objectName=="FECObserver") && ($className=="FECObserver")) { 
$donothing="";

}else{

//rest of the original code


}// close  added if
Now in phone versions the fec is not loaded, while in the rest (computer, tablet, etc) its ok.
Hope it will be helpful for somebody.
Thanks for all the zenners who helped me, for their time and patience.