आपको \Magento\Store\Model\StoreManagerInterfaceअपने निर्माता में इंजेक्ट करने की आवश्यकता नहीं है क्योंकि मूल वर्ग पहले से ही ऐसा करता है।
मुझे लगता है कि आपके ब्लॉक का विस्तार Magento\Framework\View\Element\Templateपहले से ही निम्न कोड में है:
protected $_storeManager;
public function __construct(Template\Context $context, array $data = [])
{
$this->validator = $context->getValidator();
$this->resolver = $context->getResolver();
$this->_filesystem = $context->getFilesystem();
$this->templateEnginePool = $context->getEnginePool();
$this->_storeManager = $context->getStoreManager();
$this->_appState = $context->getAppState();
$this->templateContext = $this;
$this->pageConfig = $context->getPageConfig();
parent::__construct($context, $data);
}
इस प्रकार आप अपना कोड बदल सकते हैं:
public function __construct(
\Magento\Framework\View\Element\Template\Context $context,
\Magento\Catalog\Model\Session $catalogSession,
array $data = []
)
{
parent::__construct($context, $data);
$this->_catalogSession = $catalogSession;
}