0

How to rewrite below code to fix version 2.0

$initialEnvironmentInfo = $appEmulation->startEnvironmentEmulation($storeId);

//Dealing with uninitialized translator!
Mage::app()->getTranslator()->init('frontend', true);

Thank you.

1
  • Please create object in your controller for \Magento\Framework\TranslateInterface & access it. File path magento\vendor\magento\framework\TranslateInterface.php – Jackson Dec 12 '16 at 2:43
0
 /* * @var \Magento\Store\Model\App\Emulation $_appEmulation **/

$this->_appEmulation->startEnvironmentEmulation(
                                    $storeId, 
                                    \Magento\Framework\App\Area::AREA_FRONTEND
                                    );

Take a look more detail: vendor/magento/module-store/Model/App/Emulation.php

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.