_storeManager = $storeManager; $this->_scopeConfig = $scopeConfig; $this->_backendModel = $backendModel; $this->_transaction = $transaction; $this->_configValueFactory = $configValueFactory; $this->_storeId=(int)$this->_storeManager->getStore()->getId(); $this->_storeCode=$this->_storeManager->getStore()->getCode(); } /** * Function for getting Config value of current store * @param string $path, */ public function getCurrentStoreConfigValue($path){ return $this->_scopeConfig->getValue($path,'store',$this->_storeCode); } /** * Function for setting Config value of current store * @param string $path, * @param string $value, */ public function setCurrentStoreConfigValue($path,$value){ $data = [ 'path' => $path, 'scope' => 'stores', 'scope_id' => $this->_storeId, 'scope_code' => $this->_storeCode, 'value' => $value, ]; $this->_backendModel->addData($data); $this->_transaction->addObject($this->_backendModel); $this->_transaction->save(); } }