Merge branch 'ticket-braderie'

This commit is contained in:
Marion Muszynski 2016-04-11 12:17:33 +02:00
commit b7fd07aec7
3 changed files with 17 additions and 4 deletions

View File

@ -109,7 +109,11 @@ class AdminBraderie extends AdminTab
$product_id = response.id_product;
$attibute_id = response.id_product_attribute;
$("#ean_from_product").empty().append(response.name);
if (response.attribute_name) {
$("#ean_from_product").empty().append(response.name+" - "+response.attribute_name);
} else {
$("#ean_from_product").empty().append(response.name);
}
if ($attibute_id) {
$("#hidden_attribute_id").val($attibute_id);
} else {

View File

@ -69,7 +69,7 @@ function getProductId()
LEFT JOIN `'._DB_PREFIX_.'product_lang` pl ON (pl.`id_product` = p.`id_product`)
WHERE p.`ean13` = '.pSQL($ean).'
AND pl.`id_lang` = '.(int)$cookie->id_lang.'
ORDER BY `date_add` DESC
ORDER BY `date_add` ASC
');
if (empty($result)) {
@ -80,14 +80,16 @@ function getProductId()
$result[0]['reference'] = ($result[0]['reference']) ? $result[0]['reference'] : $tmp['reference'];*/
$result = Db::getInstance()->getRow('
SELECT pa.*, pl.`name`, p.`reference` as product_reference
SELECT pa.*, pl.`name`, p.`reference` as product_reference, al.`name` as attribute_name
FROM `'._DB_PREFIX_.'product_attribute` pa
LEFT JOIN `'._DB_PREFIX_.'product` p ON (p.`id_product` = pa.`id_product`)
LEFT JOIN `'._DB_PREFIX_.'product_lang` pl ON (pl.`id_product` = p.`id_product`)
LEFT JOIN `'._DB_PREFIX_.'product_attribute_combination` pac ON (pac.`id_product_attribute` = pa.`id_product_attribute`)
LEFT JOIN `'._DB_PREFIX_.'attribute_lang` al ON (al.`id_attribute` = pac.`id_attribute`)
WHERE pa.`ean13` = '.pSQL($ean).'
AND pl.`id_lang` = '.(int)$cookie->id_lang.'
ORDER BY pa.`id_product_attribute`
DESC'
ASC'
);
$result['reference'] = (!empty($result['reference'])) ? $result['reference'] : $result['product_reference'];

View File

@ -12,6 +12,7 @@ class AdminEditFast extends AdminTab {
$title = Tools::getValue('title');
$short_description = Tools::getValue('short_description');
$description = Tools::getValue('description');
$reference = Tools::getValue('reference');
$id_lang_fast = Tools::getValue('id_lang_fast');
$nbProduct = 0;
@ -37,6 +38,9 @@ class AdminEditFast extends AdminTab {
if(isset($description[$product->id])){
$product->description[(int) $id_lang_fast] = $description[$product->id];
}
if(isset($reference[$product->id])){
$product->reference = $reference[$product->id];
}
if ($product->save()) {
$nbProduct++;
@ -117,6 +121,9 @@ class AdminEditFast extends AdminTab {
$form .= '<label>Titre</label>';
$form .= '<input type="text" name="title['.(int)$product->id.']" value="'.$product->name.'" size="70" />';
$form .= '<br /><br />';
$form .= '<label>Reference</label>';
$form .= '<input type="text" name="reference['.(int)$product->id.']" value="'.$product->reference.'" size="70" />';
$form .= '<br /><br />';
$form .= '<label>Description courte</label>';
$form .= '<textarea name="short_description['. (int) $product->id.']" class="rte" id="" cols="10" rows="10">'.$product->description_short.'</textarea>';
$form .= '<br /><br />';