// Fix some bug on advanced stock management
This commit is contained in:
@@ -137,8 +137,8 @@ class HelperFormCore extends Helper
|
||||
break;
|
||||
|
||||
case 'shop' :
|
||||
$params['html'] = $this->renderAssoShop($params['type']);
|
||||
$shops = Shop::getShops(true, null, true);
|
||||
$disable_shops = isset($params['disable_shared']) ? $params['disable_shared'] : false;
|
||||
$params['html'] = $this->renderAssoShop($disable_shops);
|
||||
if (Shop::getTotalShops(false) == 1)
|
||||
unset($this->fields_form[$fieldset_key]['form']['input'][$key]);
|
||||
break;
|
||||
@@ -190,7 +190,7 @@ class HelperFormCore extends Helper
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function renderAssoShop()
|
||||
public function renderAssoShop($disable_shared = false)
|
||||
{
|
||||
if (!Shop::isFeatureActive())
|
||||
return;
|
||||
@@ -228,8 +228,11 @@ class HelperFormCore extends Helper
|
||||
$tpl = $this->createTemplate('assoshop.tpl');
|
||||
$tree = Shop::getTree();
|
||||
$nb_shop = 0;
|
||||
foreach ($tree as $value)
|
||||
foreach ($tree as &$value)
|
||||
{
|
||||
$value['disable_shops'] = (isset($value[$disable_shared]) && $value[$disable_shared]);
|
||||
$nb_shop += count($value['shops']);
|
||||
}
|
||||
$tpl->assign(array(
|
||||
'input' => array(
|
||||
'type' => 'shop',
|
||||
|
||||
Reference in New Issue
Block a user