Merge branch 'ticket-AssociateProducts' into develop

This commit is contained in:
Marion Muszynski 2016-10-05 14:36:33 +02:00
commit 77222b5026
2 changed files with 4 additions and 2 deletions

View File

@ -50,6 +50,8 @@ if ($excludeIds && $excludeIds != 'NaN')
else
$excludeIds = '';
$enabledOnly = Tools::getValue('enabledOnly', false);
// Excluding downloadable products from packs because download from pack is not supported
$excludeVirtuals = (bool)Tools::getValue('excludeVirtuals', false);
@ -59,6 +61,7 @@ FROM `'._DB_PREFIX_.'product` p
LEFT JOIN `'._DB_PREFIX_.'product_lang` pl ON (pl.id_product = p.id_product)
WHERE (pl.name LIKE \'%'.pSQL($query).'%\' OR p.reference LIKE \'%'.pSQL($query).'%\') AND pl.id_lang = '.(int)($cookie->id_lang).
(!empty($excludeIds) ? ' AND p.id_product NOT IN ('.$excludeIds.') ' : ' ').
($enabledOnly ? ' AND p.`active` = 1 ' : ' ').
($excludeVirtuals ? 'AND p.id_product NOT IN (SELECT pd.id_product FROM `'._DB_PREFIX_.'product_download` pd WHERE (pd.id_product = p.id_product))' : ''));
if ($items)

View File

@ -3578,7 +3578,7 @@ class AdminProducts extends AdminTab
}
}).result(addAccessory);
$(\'#product_autocomplete_input\').setOptions({
extraParams: {excludeIds : getAccessorieIds()}
extraParams: {excludeIds : getAccessorieIds(), enabledOnly : 1}
});
});
</script>
@ -4400,7 +4400,6 @@ class AdminProducts extends AdminTab
$(\'#curPackItemName\').setOptions({
extraParams: {excludeIds : getSelectedIds(), excludeVirtuals : 1}
});
});