// Fix added GroupShop Manufacturer

This commit is contained in:
lLefevre
2011-10-28 13:01:20 +00:00
parent 737ba0736d
commit 02bf347621
2 changed files with 15 additions and 4 deletions
@@ -101,7 +101,7 @@ function check_all_shop() {ldelim}
</td>
</tr>
{if $input.type = 'shop'}
{if $input.type == 'shop'}
{assign var=j value=0}
{foreach $groupData['shops'] as $shopID => $shopData}
{if ((isset($fields_value.shop[$shopID]) && in_array($form_id, $fields_value.shop[$shopID])) || !$form_id)}
@@ -303,6 +303,9 @@ class AdminManufacturersControllerCore extends AdminController
)
);
if (!($manufacturer = $this->loadObject(true)))
return;
/*
* Where it used? You can not insert into a table or in the fields of a table
*/
@@ -321,9 +324,6 @@ class AdminManufacturersControllerCore extends AdminController
'class' => 'button'
);
if (!($manufacturer = $this->loadObject(true)))
return;
$image = cacheImage(_PS_MANU_IMG_DIR_.'/'.$manufacturer->id.'.jpg', $this->table.'_'.(int)$manufacturer->id.'.'.$this->imageType, 350, $this->imageType, true);
$this->fields_value = array(
@@ -346,6 +346,17 @@ class AdminManufacturersControllerCore extends AdminController
)), ENT_COMPAT, 'UTF-8');
}
//Added values of object Shop
if ($manufacturer->id)
{
$assos = array();
$sql = 'SELECT `id_group_shop`, `'.pSQL($this->identifier).'`
FROM `'._DB_PREFIX_.pSQL($this->table).'_group_shop`
WHERE `'.pSQL($this->identifier).'` = '.(int)$manufacturer->id;
foreach (Db::getInstance()->executeS($sql) as $row)
$this->fields_value['shop'][$row['id_group_shop']][] = $row[$this->identifier];
}
return parent::initForm();
}