Skip to main content
fixed code
Source Link
rafal-kos
  • 676
  • 4
  • 15

Add to custom helper this dependency

\Magento\Store\Model\App\Emulation $emulation,
...
$this->emulation = $emulation;

and then in code before fetching logo run this

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

Once you finish what you wanted just restore original environment

$this->emulation->stopEnvironmentEmulation();

Add to custom helper this dependency

\Magento\Store\Model\App\Emulation $emulation,
...
$this->emulation = $emulation;

and then in code before fetching logo run this

$this->emulation->startEnvironmentEmulation($storeId);

Once you finish what you wanted just restore original environment

$this->emulation->stopEnvironmentEmulation();

Add to custom helper this dependency

\Magento\Store\Model\App\Emulation $emulation,
...
$this->emulation = $emulation;

and then in code before fetching logo run this

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

Once you finish what you wanted just restore original environment

$this->emulation->stopEnvironmentEmulation();
deleted 1 character in body
Source Link
Siarhey Uchukhlebau
  • 16.2k
  • 11
  • 55
  • 88

Add to custom helper this dependency

\Magento\Store\Model\App\Emulation $emulation,
...
$this->emulation = $emulation;

and then in code before fetching logo run this

$this->emulation->startEnvironmentEmulation($storeId);

Once you finish what you wanted just restore original environment

    $this->emulation->stopEnvironmentEmulation();

Add to custom helper this dependency

\Magento\Store\Model\App\Emulation $emulation,
...
$this->emulation = $emulation;

and then in code before fetching logo run this

$this->emulation->startEnvironmentEmulation($storeId);

Once you finish what you wanted just restore original environment

    $this->emulation->stopEnvironmentEmulation();

Add to custom helper this dependency

\Magento\Store\Model\App\Emulation $emulation,
...
$this->emulation = $emulation;

and then in code before fetching logo run this

$this->emulation->startEnvironmentEmulation($storeId);

Once you finish what you wanted just restore original environment

$this->emulation->stopEnvironmentEmulation();
Source Link
rafal-kos
  • 676
  • 4
  • 15

Add to custom helper this dependency

\Magento\Store\Model\App\Emulation $emulation,
...
$this->emulation = $emulation;

and then in code before fetching logo run this

$this->emulation->startEnvironmentEmulation($storeId);

Once you finish what you wanted just restore original environment

    $this->emulation->stopEnvironmentEmulation();