diff --git a/admin-dev/tabs/AdminDiscounts.php b/admin-dev/tabs/AdminDiscounts.php index 2cc329f71..64fc5ed85 100644 --- a/admin-dev/tabs/AdminDiscounts.php +++ b/admin-dev/tabs/AdminDiscounts.php @@ -123,8 +123,6 @@ class AdminDiscounts extends AdminTab $object->update(); $objectNew = new $this->className(); $this->copyFromPost($objectNew, $this->table); - $shop = new Shop((int)$objectNew->id_shop); - $objectNew->id_group_shop = (int)$shop->id_group_shop; $result = $objectNew->add(); if (Validate::isLoadedObject($objectNew)) $this->afterDelete($objectNew, $object->id); @@ -134,8 +132,6 @@ class AdminDiscounts extends AdminTab if (($categories = Tools::getValue('categoryBox')) === false OR (!empty($categories) AND !is_array($categories))) $this->_errors[] = Tools::displayError('Please set a category for this voucher.'); $this->copyFromPost($object, $this->table); - $shop = new Shop((int)$objectNew->id_shop); - $objectNew->id_group_shop = (int)$shop->id_group_shop; $result = $object->update(true, false, $categories); } if (!$result) @@ -163,8 +159,6 @@ class AdminDiscounts extends AdminTab { $object = new $this->className(); $this->copyFromPost($object, $this->table); - $shop = new Shop((int)$objectNew->id_shop); - $objectNew->id_group_shop = (int)$shop->id_group_shop; $categories = Tools::getValue('categoryBox', null); if (!$object->add(true, false, $categories)) $this->_errors[] = Tools::displayError('An error occurred while creating object.').' '.$this->table.''; @@ -201,7 +195,7 @@ class AdminDiscounts extends AdminTab } } - Tools::redirectAdmin($currentIndex.'&'.$this->identifier.'='.$object->id.'&conf=3&token='.$token); + Tools::redirectAdmin(self::$currentIndex.'&'.$this->identifier.'='.$object->id.'&conf=3&token='.$token); } } else @@ -359,15 +353,6 @@ class AdminDiscounts extends AdminTab
- -