Example #1
0
 /**
  * Rewrite in order to clear configuration cache
  *
  * @return $this
  */
 public function afterDelete()
 {
     $this->_storeManager->reinitStores();
     parent::afterDelete();
     return $this;
 }
Example #2
0
 /**
  * Rewrite in order to clear configuration cache
  *
  * @return $this
  */
 public function afterDelete()
 {
     parent::afterDelete();
     $this->_configCacheType->clean();
     return $this;
 }
Example #3
0
 /**
  * After rule delete
  * Re-declared for dispatch tax_settings_change_after event
  *
  * @return $this
  */
 public function afterDelete()
 {
     $this->_eventManager->dispatch('tax_settings_change_after');
     return parent::afterDelete();
 }
Example #4
0
 /**
  * Rewrite in order to clear configuration cache
  *
  * @return $this
  */
 public function afterDelete()
 {
     parent::afterDelete();
     $this->_configCacheType->clean();
     if ($this->getId() === $this->getGroup()->getDefaultStoreId()) {
         $ids = $this->getGroup()->getStoreIds();
         if (!empty($ids) && count($ids) > 1) {
             unset($ids[$this->getId()]);
             $defaultId = current($ids);
         } else {
             $defaultId = null;
         }
         $this->getGroup()->setDefaultStoreId($defaultId);
         $this->getGroup()->save();
     }
     return $this;
 }
Example #5
0
 /**
  * @inheritdoc
  */
 public function afterDelete()
 {
     $result = parent::afterDelete();
     if ($this->getId() === $this->getWebsite()->getDefaultGroupId()) {
         $ids = $this->getWebsite()->getGroupIds();
         if (!empty($ids) && count($ids) > 1) {
             unset($ids[$this->getId()]);
             $defaultId = current($ids);
         } else {
             $defaultId = null;
         }
         $this->getWebsite()->setDefaultGroupId($defaultId);
         $this->getWebsite()->save();
     }
     return $result;
 }