// Fix product stocks on multishop

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@15379 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
rGaillard
2012-05-18 14:32:29 +00:00
parent 94922d1c53
commit 66c9b52d43
5 changed files with 17 additions and 8 deletions
+4 -1
View File
@@ -466,7 +466,10 @@ function runAdminTab($tab, $ajaxMode = false)
{ {
echo '<div class="multishop_info">'; echo '<div class="multishop_info">';
if (Shop::getContext() == Shop::CONTEXT_GROUP) if (Shop::getContext() == Shop::CONTEXT_GROUP)
printf(translate('You are configuring your store for group shop %s'), '<b>'.Context::getContext()->shop->getGroup()->name.'</b>'); {
$shop_group = new ShopGroup((int)Shop::getContextShopGroupID());
printf(translate('You are configuring your store for group shop %s'), '<b>'.$shop_group->name.'</b>');
}
elseif (Shop::getContext() == Shop::CONTEXT_SHOP) elseif (Shop::getContext() == Shop::CONTEXT_SHOP)
printf(translate('You are configuring your store for shop %s'), '<b>'.Context::getContext()->shop->name.'</b>'); printf(translate('You are configuring your store for shop %s'), '<b>'.Context::getContext()->shop->name.'</b>');
echo '</div>'; echo '</div>';
+5 -2
View File
@@ -151,8 +151,11 @@ echo '
{ {
if (Shop::getContext() == Shop::CONTEXT_ALL) if (Shop::getContext() == Shop::CONTEXT_ALL)
$youEditFieldFor = translate('A modification of this field will be applied for all shops'); $youEditFieldFor = translate('A modification of this field will be applied for all shops');
else if (Shop::getContext() == Shop::CONTEXT_GROUP) elseif (Shop::getContext() == Shop::CONTEXT_GROUP)
$youEditFieldFor = sprintf(translate('A modification of this field will be applied for all shops of group %s'), '<b>'.Context::getContext()->shop->getGroup()->name.'</b>'); {
$shop_group = new ShopGroup((int)Shop::getContextShopGroupID());
$youEditFieldFor = sprintf(translate('A modification of this field will be applied for all shops of group %s'), '<b>'.$shop_group->name.'</b>');
}
else else
$youEditFieldFor = sprintf(translate('A modification of this field will be applied for the shop %s'), '<b>'.Context::getContext()->shop->name.'</b>'); $youEditFieldFor = sprintf(translate('A modification of this field will be applied for the shop %s'), '<b>'.Context::getContext()->shop->name.'</b>');
echo 'hints.html(hints.html()+\'<br /><span class="red">'.addslashes($youEditFieldFor).'</span>\');'; echo 'hints.html(hints.html()+\'<br /><span class="red">'.addslashes($youEditFieldFor).'</span>\');';
+1 -1
View File
@@ -1292,7 +1292,7 @@ class AdminControllerCore extends Controller
'multi_shop' => Shop::isFeatureActive(), 'multi_shop' => Shop::isFeatureActive(),
'shop_list' => Helper::renderShopList(), 'shop_list' => Helper::renderShopList(),
'shop' => $this->context->shop, 'shop' => $this->context->shop,
'shop_group' => $this->context->shop->getGroup(), 'shop_group' => new ShopGroup((int)Shop::getContextShopGroupID()),
'tab' => $tab, 'tab' => $tab,
'current_parent_id' => (int)Tab::getCurrentParentId(), 'current_parent_id' => (int)Tab::getCurrentParentId(),
'tabs' => $tabs, 'tabs' => $tabs,
+3 -3
View File
@@ -418,7 +418,7 @@ class StockAvailableCore extends ObjectModel
// if we are in shop_group context // if we are in shop_group context
if (Shop::getContext() == Shop::CONTEXT_GROUP) if (Shop::getContext() == Shop::CONTEXT_GROUP)
{ {
$shop_group = $context->shop->getGroup(); $shop_group = new ShopGroup((int)Shop::getContextShopGroupID());
// if quantities are shared between shops of the group // if quantities are shared between shops of the group
if ($shop_group->share_stock) if ($shop_group->share_stock)
@@ -562,7 +562,7 @@ class StockAvailableCore extends ObjectModel
$id_shop = $context->shop->id; $id_shop = $context->shop->id;
// if we are in $shop_group context // if we are in $shop_group context
$shop_group = $context->shop->getGroup(); $shop_group = new ShopGroup((int)Shop::getContextShopGroupID());
// if quantities are shared between shops of the group // if quantities are shared between shops of the group
if ($shop_group->share_stock) if ($shop_group->share_stock)
@@ -614,7 +614,7 @@ class StockAvailableCore extends ObjectModel
if (is_null($id_shop)) if (is_null($id_shop))
$id_shop = $context->shop->id; $id_shop = $context->shop->id;
$shop_group = $context->shop->getGroup(); $shop_group = new ShopGroup((int)Shop::getContextShopGroupID());
// if quantities are shared between shops of the group // if quantities are shared between shops of the group
if ($shop_group->share_stock) if ($shop_group->share_stock)
+4 -1
View File
@@ -729,7 +729,10 @@ class AdminModulesControllerCore extends AdminController
if (Shop::getContext() == Shop::CONTEXT_SHOP) if (Shop::getContext() == Shop::CONTEXT_SHOP)
$toolbar .= 'shop <b>'.$this->context->shop->name.'</b>'; $toolbar .= 'shop <b>'.$this->context->shop->name.'</b>';
elseif (Shop::getContext() == Shop::CONTEXT_GROUP) elseif (Shop::getContext() == Shop::CONTEXT_GROUP)
$toolbar .= 'all shops of group shop <b>'.$this->context->shop->getGroup()->name.'</b>'; {
$shop_group = new ShopGroup((int)Shop::getContextShopGroupID())
$toolbar .= 'all shops of group shop <b>'.$shop_group->name.'</b>';
}
else else
$toolbar .= 'all shops'; $toolbar .= 'all shops';
$toolbar .= '</th> $toolbar .= '</th>