I have a custom module that works with the default Magento quote factory. Here, I am fetching the quote data using the,
\Magento\Quote\Model\QuoteFactory $quoteFactory
and in my block I am getting the store name as
public function getStoreName() {
return $this->_storeManager->getStore()->getName();
}
However, when there are multiple store views, the above code always displays the store as Default Store View.
Is there anyway we can get the store name according to the quote object that was created?
Please can anyone help?
Best Answer
You can fetch your store id from your quote object and after that from id you can fetch your store name from your store id.
Please see my code.