diff --git a/lib/Foomo/Magento2/Boostrap.php b/lib/Foomo/Magento2/Boostrap.php index eb67040..6e099db 100644 --- a/lib/Foomo/Magento2/Boostrap.php +++ b/lib/Foomo/Magento2/Boostrap.php @@ -18,8 +18,11 @@ class Boostrap */ public static function bootstrap() { + if (!class_exists('\Magento\Framework\App\Bootstrap')) { return self::init(); + } else if(!self::$bootstrap) { + self::$bootstrap = Bootstrap::create(BP, $_SERVER); } return self::$bootstrap; } @@ -63,6 +66,7 @@ class Boostrap { if (!class_exists('\Magento\Framework\App\Bootstrap')) { self::init(); + } else { } return \Magento\Framework\App\ObjectManager::getInstance();