diff --git a/admin-dev/themes/template/helper/form/form.tpl b/admin-dev/themes/template/helper/form/form.tpl
index 40020db46..0fda75e53 100644
--- a/admin-dev/themes/template/helper/form/form.tpl
+++ b/admin-dev/themes/template/helper/form/form.tpl
@@ -255,10 +255,7 @@
{elseif $input.type == 'categories'}
{include file='helper/form/form_category.tpl' categories=$input.values}
{elseif $input.type == 'asso_shop' && isset($asso_shop) && $asso_shop}
-
-
{$asso_shop}
-
{elseif $input.type == 'color'}
identifier).'`
FROM `'._DB_PREFIX_.pSQL($this->table).'_'.$type.'`';
+
foreach (Db::getInstance()->executeS($sql) as $row)
$assos[$row['id_'.$type]][] = $row[$this->identifier];
diff --git a/classes/HelperForm.php b/classes/HelperForm.php
index 9d32482df..381260281 100644
--- a/classes/HelperForm.php
+++ b/classes/HelperForm.php
@@ -75,6 +75,12 @@ class HelperFormCore extends Helper
if ($this->submit_action == '')
$this->submit_action = 'submitAdd'.$this->table;
+ if (isset($this->fields_form['asso_shop']) && Shop::isFeatureActive())
+ if ($this->fields_form['asso_shop'] == 'group')
+ $asso_shop = $this->displayAssoShop('group_shop');
+ elseif ($this->fields_form['asso_shop'] == 'shop')
+ $asso_shop = $this->displayAssoShop();
+
$iso = $this->context->language->iso_code;
$this->tpl->assign(array(
'submit_action' => $this->submit_action,
@@ -95,7 +101,7 @@ class HelperFormCore extends Helper
'vat_number' => file_exists(_PS_MODULE_DIR_.'vatnumber/ajax.php'),
'module_dir' => _MODULE_DIR_,
'contains_states' => (isset($this->fields_value['id_country']) && isset($this->fields_value['id_state'])) ? Country::containsStates($this->fields_value['id_country']) : null,
- 'asso_shop' => (isset($this->fields_form['asso_shop']) && $this->fields_form['asso_shop']) ? $this->displayAssoShop() : null,
+ 'asso_shop' => isset($asso_shop) ? $asso_shop : null,
'iso' => file_exists(_PS_ROOT_DIR_.'/js/tiny_mce/langs/'.$iso.'.js') ? $iso : 'en',
'path_css' => _THEME_CSS_DIR_,
'ad' => dirname($_SERVER["PHP_SELF"]),
diff --git a/controllers/admin/AdminCurrenciesController.php b/controllers/admin/AdminCurrenciesController.php
index d7d331947..04e406eb5 100644
--- a/controllers/admin/AdminCurrenciesController.php
+++ b/controllers/admin/AdminCurrenciesController.php
@@ -218,6 +218,7 @@ class AdminCurrenciesControllerCore extends AdminController
),
array(
'type' => 'asso_shop',
+ 'label' => 'Shop:',
'name' => ''
)
),
@@ -225,7 +226,7 @@ class AdminCurrenciesControllerCore extends AdminController
'title' => $this->l(' Save '),
'class' => 'button'
),
- 'asso_shop' => Shop::isFeatureActive()
+ 'asso_shop' => 'shop'
);
parent::__construct();
}
diff --git a/controllers/admin/AdminZonesController.php b/controllers/admin/AdminZonesController.php
index f0334b261..e6cbf5747 100644
--- a/controllers/admin/AdminZonesController.php
+++ b/controllers/admin/AdminZonesController.php
@@ -80,9 +80,11 @@ class AdminZonesControllerCore extends AdminController
),
array(
'type' => 'asso_shop',
+ 'label' => 'Shop groups:',
'name' => ''
)
),
+ 'asso_shop' => 'group',
'submit' => array(
'title' => $this->l(' Save '),
'class' => 'button'