// categories association for product with multishop and context
This commit is contained in:
@@ -39,7 +39,15 @@
|
|||||||
<label for="category_block">{l s='Associated categories:'}</label>
|
<label for="category_block">{l s='Associated categories:'}</label>
|
||||||
</td>
|
</td>
|
||||||
<td class="col-right">
|
<td class="col-right">
|
||||||
<div id="category_block">{$category_tree}</div>
|
<div id="category_block">
|
||||||
|
{if !$is_shop_context}
|
||||||
|
<div class="warn">
|
||||||
|
{/if}
|
||||||
|
{$category_tree}
|
||||||
|
{if !$is_shop_context}
|
||||||
|
</div>
|
||||||
|
{/if}
|
||||||
|
</div>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
@@ -48,10 +56,12 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<td></td>
|
<td></td>
|
||||||
<td class="col-right">
|
<td class="col-right">
|
||||||
<a class="button bt-icon confirm_leave" href="{$link->getAdminLink('AdminCategories')}&addcategory">
|
{if $is_shop_context}
|
||||||
<img src="../img/admin/add.gif" alt="{l s='Create new category'}" title="{l s='Create new category'}" />
|
<a class="button bt-icon confirm_leave" href="{$link->getAdminLink('AdminCategories')}&addcategory">
|
||||||
<span>{l s='Create new category'}</span>
|
<img src="../img/admin/add.gif" alt="{l s='Create new category'}" title="{l s='Create new category'}" />
|
||||||
</a>
|
<span>{l s='Create new category'}</span>
|
||||||
|
</a>
|
||||||
|
{/if}
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
|
|||||||
@@ -2692,13 +2692,18 @@ class AdminProductsControllerCore extends AdminController
|
|||||||
|
|
||||||
$tab_root = array('id_category' => $root->id, 'name' => $root->name);
|
$tab_root = array('id_category' => $root->id, 'name' => $root->name);
|
||||||
$helper = new Helper();
|
$helper = new Helper();
|
||||||
|
if (Shop::getContext() != Shop::CONTEXT_SHOP)
|
||||||
|
$category_tree = $this->l('You must select a shop if you want to put your product into a particular shop.');
|
||||||
|
else
|
||||||
|
$category_tree = $helper->renderCategoryTree($tab_root, $selected_cat, 'categoryBox', false, true);
|
||||||
$data->assign(array('default_category' => $default_category,
|
$data->assign(array('default_category' => $default_category,
|
||||||
'selected_cat_ids' => implode(',', array_keys($selected_cat)),
|
'selected_cat_ids' => implode(',', array_keys($selected_cat)),
|
||||||
'selected_cat' => $selected_cat,
|
'selected_cat' => $selected_cat,
|
||||||
'id_category_default' => $product->getDefaultCategory(),
|
'id_category_default' => $product->getDefaultCategory(),
|
||||||
'category_tree' => $helper->renderCategoryTree($tab_root, $selected_cat, 'categoryBox', false, true),
|
'category_tree' => $category_tree,
|
||||||
'product' => $product,
|
'product' => $product,
|
||||||
'link' => $this->context->link
|
'link' => $this->context->link,
|
||||||
|
'is_shop_context' => Shop::getContext() == Shop::CONTEXT_SHOP
|
||||||
));
|
));
|
||||||
|
|
||||||
$this->tpl_form_vars['custom_form'] = $data->fetch();
|
$this->tpl_form_vars['custom_form'] = $data->fetch();
|
||||||
|
|||||||
Reference in New Issue
Block a user