diff --git a/controllers/admin/AdminCustomersController.php b/controllers/admin/AdminCustomersController.php index ed502512f..ea1d1d3dd 100644 --- a/controllers/admin/AdminCustomersController.php +++ b/controllers/admin/AdminCustomersController.php @@ -413,20 +413,6 @@ class AdminCustomersControllerCore extends AdminController array_splice($this->fields_form['input'], $k, 1); } - if (Shop::isFeatureActive()) - { - $this->fields_form['input'][] = array( - 'type' => 'select', - 'label' => $this->l('Shop:'), - 'name' => 'id_shop', - 'options' => array( - 'query' => Shop::getShops(), - 'id' => 'id_shop', - 'name' => 'name' - ), - ); - } - if (Configuration::get('PS_B2B_ENABLE')) { $risks = Risk::getRisks(); @@ -502,7 +488,6 @@ class AdminCustomersControllerCore extends AdminController 'years' => $this->getFieldValue($obj, 'birthday') ? $birthday[0] : 0, 'months' => $this->getFieldValue($obj, 'birthday') ? $birthday[1] : 0, 'days' => $this->getFieldValue($obj, 'birthday') ? $birthday[2] : 0, - 'id_shop' => (int)Configuration::get('PS_SHOP_DEFAULT') ); // Added values of object Group @@ -526,6 +511,11 @@ class AdminCustomersControllerCore extends AdminController return parent::renderForm(); } + public function beforeAdd($customer) + { + $customer->id_shop = $this->context->shop->getID(true); + } + public function renderView() { if (!($customer = $this->loadObject()))