[-] BO : BugFix : #PSCFV-3537 : Product Indexing lost when editing a product
This commit is contained in:
1 parent
3b90e52bc3
commit
160943868a
2 files changed
+26
No files matched your search
@@ -114,6 +114,10 @@
|
|||||||
{/block}
|
{/block}
|
||||||
|
|
||||||
{block name="script"}
|
{block name="script"}
|
||||||
|
var ids_category = new Array();
|
||||||
|
{foreach $ids_category as $key => $id_category}
|
||||||
|
ids_category[{$key}] = {$id_category};
|
||||||
|
{/foreach}
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
$('input[name=useImportData]').click(function() {
|
$('input[name=useImportData]').click(function() {
|
||||||
if ($(this).attr('id') == 'useImportData_on')
|
if ($(this).attr('id') == 'useImportData_on')
|
||||||
@@ -121,5 +125,21 @@
|
|||||||
else
|
else
|
||||||
$('#shop_list, #data_list').slideUp('slow');
|
$('#shop_list, #data_list').slideUp('slow');
|
||||||
});
|
});
|
||||||
|
$('#id_category, #importFromShop').change(function(){
|
||||||
|
shop_id = $('#importFromShop').val();
|
||||||
|
category_id = $('#id_category').val();
|
||||||
|
if (ids_category[shop_id] != category_id)
|
||||||
|
disableProductsDuplication();
|
||||||
|
else
|
||||||
|
enableProductsDuplication();
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
function disableProductsDuplication()
|
||||||
|
{
|
||||||
|
$('input[name="importData[product_attribute]"], input[name="importData[image]"], input[name="importData[product]"], input[name="importData[stock_available]"], input[name="importData[discount]"]').removeAttr('checked').attr('disabled', 'disabled');
|
||||||
|
}
|
||||||
|
function enableProductsDuplication()
|
||||||
|
{
|
||||||
|
$('input[name="importData[product_attribute]"], input[name="importData[image]"], input[name="importData[product]"], input[name="importData[stock_available]"], input[name="importData[discount]"]').removeAttr('disabled').attr('checked', 'checked');
|
||||||
|
}
|
||||||
{/block}
|
{/block}
|
||||||
@@ -521,10 +521,16 @@ class AdminShopControllerCore extends AdminController
|
|||||||
'id_theme_checked' => (isset($obj->id_theme) ? $obj->id_theme : $id_theme)
|
'id_theme_checked' => (isset($obj->id_theme) ? $obj->id_theme : $id_theme)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
$ids_category = array();
|
||||||
|
$shops = Shop::getShops(false);
|
||||||
|
foreach ($shops as $shop)
|
||||||
|
$ids_category[$shop['id_shop']] = $shop['id_category'];
|
||||||
|
|
||||||
$this->tpl_form_vars = array(
|
$this->tpl_form_vars = array(
|
||||||
'disabled' => $disabled,
|
'disabled' => $disabled,
|
||||||
'checked' => (Tools::getValue('addshop') !== false) ? true : false,
|
'checked' => (Tools::getValue('addshop') !== false) ? true : false,
|
||||||
'defaultShop' => (int)Configuration::get('PS_SHOP_DEFAULT'),
|
'defaultShop' => (int)Configuration::get('PS_SHOP_DEFAULT'),
|
||||||
|
'ids_category' => $ids_category,
|
||||||
);
|
);
|
||||||
if (isset($this->fields_import_form))
|
if (isset($this->fields_import_form))
|
||||||
$this->tpl_form_vars = array_merge($this->tpl_form_vars, array('form_import' => $this->fields_import_form));
|
$this->tpl_form_vars = array_merge($this->tpl_form_vars, array('form_import' => $this->fields_import_form));
|
||||||
|
|||||||
Reference in new issue
Block a user