[-] BO : BugFix : #PSCFV-2205 : Cannot associate shop with products

This commit is contained in:
vChabot
2012-05-15 15:51:42 +00:00
parent 9a70c814c0
commit 19aaffadfa
2 changed files with 22 additions and 4 deletions
@@ -71,8 +71,17 @@
<div class="hint" style="display:block;">{l s='The default category is the category which is displayed by default.'}</div> <div class="hint" style="display:block;">{l s='The default category is the category which is displayed by default.'}</div>
</td> </td>
</tr> </tr>
{if $is_multishop && !$is_shop_context}
<tr>
<td class="col-left">
<label>{l s='Associated shops:'}</label>
</td>
<td class="col-right">
{$asso_shop}
</td>
</tr>
{/if}
</table> </table>
<div class="separation"></div> <div class="separation"></div>
<table> <table>
<tr> <tr>
+12 -3
View File
@@ -1425,6 +1425,7 @@ class AdminProductsControllerCore extends AdminController
$this->updateAccessories($this->object); $this->updateAccessories($this->object);
$this->updatePackItems($this->object); $this->updatePackItems($this->object);
$this->updateDownloadProduct($this->object); $this->updateDownloadProduct($this->object);
$this->updateAssoShop($this->object->id);
if (empty($this->errors)) if (empty($this->errors))
{ {
@@ -1526,9 +1527,6 @@ class AdminProductsControllerCore extends AdminController
{ {
if ($this->isTabSubmitted('Shipping')) if ($this->isTabSubmitted('Shipping'))
$this->addCarriers(); $this->addCarriers();
if ($this->isTabSubmitted('Associations'))
$this->updateAccessories($object);
if ($this->isTabSubmitted('Suppliers')) if ($this->isTabSubmitted('Suppliers'))
$this->processSuppliers(); $this->processSuppliers();
if ($this->isTabSubmitted('Warehouses')) if ($this->isTabSubmitted('Warehouses'))
@@ -1547,6 +1545,11 @@ class AdminProductsControllerCore extends AdminController
$this->processCustomizationConfiguration(); $this->processCustomizationConfiguration();
if ($this->isTabSubmitted('Attachments')) if ($this->isTabSubmitted('Attachments'))
$this->processAttachments(); $this->processAttachments();
if ($this->isTabSubmitted('Associations'))
{
$this->updateAccessories($object);
$this->updateAssoShop($object->id);
}
$this->updatePackItems($object); $this->updatePackItems($object);
$this->updateDownloadProduct($object, 1); $this->updateDownloadProduct($object, 1);
@@ -2553,6 +2556,10 @@ 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();
$helper_form = new HelperForm();
$helper_form->table = 'product';
$helper_form->identifier = 'id_product';
$helper_form->id = $product->id;
$category_tree = $helper->renderCategoryTree($tab_root, $selected_cat, 'categoryBox', false, true, array(), false, true); $category_tree = $helper->renderCategoryTree($tab_root, $selected_cat, 'categoryBox', false, true, array(), 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)),
@@ -2561,6 +2568,8 @@ class AdminProductsControllerCore extends AdminController
'category_tree' => $category_tree, 'category_tree' => $category_tree,
'product' => $product, 'product' => $product,
'link' => $this->context->link, 'link' => $this->context->link,
'asso_shop' => $helper_form->renderAssoShop(),
'is_multishop' => Shop::isFeatureActive(),
'is_shop_context' => Shop::getContext() == Shop::CONTEXT_SHOP 'is_shop_context' => Shop::getContext() == Shop::CONTEXT_SHOP
)); ));