// Fix shop association in helper form for group shops #PSTEST-865
This commit is contained in:
@@ -212,17 +212,27 @@ class HelperFormCore extends Helper
|
|||||||
switch (Shop::getContext())
|
switch (Shop::getContext())
|
||||||
{
|
{
|
||||||
case Shop::CONTEXT_SHOP :
|
case Shop::CONTEXT_SHOP :
|
||||||
$assos[Shop::getContextShopID()] = Shop::getContextShopID();
|
if ($type == 'shop')
|
||||||
|
$assos[Shop::getContextShopID()] = Shop::getContextShopID();
|
||||||
|
else
|
||||||
|
$assos[Shop::getContextGroupShopID()] = Shop::getContextGroupShopID();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case Shop::CONTEXT_GROUP :
|
case Shop::CONTEXT_GROUP :
|
||||||
foreach (Shop::getShops(false, Shop::getContextGroupShopID(), true) as $id_shop)
|
if ($type == 'shop')
|
||||||
$assos[$id_shop] = $id_shop;
|
foreach (Shop::getShops(false, Shop::getContextGroupShopID(), true) as $id_shop)
|
||||||
|
$assos[$id_shop] = $id_shop;
|
||||||
|
else
|
||||||
|
$assos[Shop::getContextGroupShopID()] = Shop::getContextGroupShopID();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default :
|
default :
|
||||||
foreach (Shop::getShops(false, null, true) as $id_shop)
|
if ($type == 'shop')
|
||||||
$assos[$id_shop] = $id_shop;
|
foreach (Shop::getShops(false, null, true) as $id_shop)
|
||||||
|
$assos[$id_shop] = $id_shop;
|
||||||
|
else
|
||||||
|
foreach (Shop::getTree() as $group_shop)
|
||||||
|
$assos[$group_shop['id']] = $group_shop['id'];
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user