diff --git a/adm/ajax_products_list.php b/adm/ajax_products_list.php index 3012fc80..146edd15 100755 --- a/adm/ajax_products_list.php +++ b/adm/ajax_products_list.php @@ -56,7 +56,7 @@ $enabledOnly = Tools::getValue('enabledOnly', false); $excludeVirtuals = (bool)Tools::getValue('excludeVirtuals', false); $items = Db::getInstance()->ExecuteS(' -SELECT p.`id_product`, `reference`, pl.`name`, i.`id_image` +SELECT p.`id_product`, `reference`, pl.`name`, pl.`link_rewrite`, i.`id_image` FROM `'._DB_PREFIX_.'product` p LEFT JOIN `'._DB_PREFIX_.'product_lang` pl ON (pl.id_product = p.id_product) LEFT JOIN `'._DB_PREFIX_.'image` i ON (i.`id_product` = p.`id_product` AND i.`cover` = 1) @@ -64,13 +64,14 @@ WHERE (pl.name LIKE \'%'.pSQL($query).'%\' OR p.reference LIKE \'%'.pSQL($query) (!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))' : '')); - +$link = new Link(); if ($items) foreach ($items AS $item){ $img_path = ''; if(isset($item['id_image']) && !empty($item['id_image'])){ - $image_obj = new Image((int)$item['id_image']); - $img_path = (isset($image_obj)?$image_obj->getExistingImgPath():''); + // $image_obj = new Image((int)$item['id_image']); + // $img_path = (isset($image_obj)?$image_obj->getExistingImgPath():''); + $img_path = $link->getImageLink($item['link_rewrite'], (int)$item['id_image'], 'small'); } echo trim($item['name']).(!empty($item['reference']) ? ' (ref: '.$item['reference'].')' : '').'|'.(int)($item['id_product']).(!empty($img_path) ?'|'.($img_path):'')."\n"; } diff --git a/adm/tabs/AdminProducts.php b/adm/tabs/AdminProducts.php index 882d304a..a1fd5fdb 100755 --- a/adm/tabs/AdminProducts.php +++ b/adm/tabs/AdminProducts.php @@ -3627,7 +3627,7 @@ class AdminProducts extends AdminTab scroll:false, cacheLength:0, formatItem: function(item) { - return \' \'+item[1]+\' - \'+item[0]; + return \' \'+item[1]+\' - \'+item[0]; }, }).result(addAccessory); $(\'#product_autocomplete_input\').setOptions({ diff --git a/js/admin.js b/js/admin.js index 314f3d0c..f3bd8911 100755 --- a/js/admin.js +++ b/js/admin.js @@ -334,7 +334,7 @@ function addAccessory(event, data, formatted) var $imgAccessories = $('#imgAccessories'); /* delete product from select + add product line to the div, input_name, input_ids elements */ - $divAccessories.html($divAccessories.html() + ' ' + productName + '
'); + $divAccessories.html($divAccessories.html() + ' ' + productName + '
'); $nameAccessories.val($nameAccessories.val() + productName + 'ยค'); $inputAccessories.val($inputAccessories.val() + productId + '-'); $imgAccessories.val($imgAccessories.val() + productImg + ',');