_html .= '
'.$this->l('Products selection').'


'; if($current_sale) { if($current_sale == 999999 || $sale = new Sale($current_sale)) { $link = new Link(); $this->_html .= ' '; $sale_products = array(); $sale_products = $sale->getProducts(TRUE); foreach($sale_products as $id_product) { $product = new Product($id_product, FALSE, (int) $cookie->id_lang); $attributes = array(); foreach(Db::getInstance()->ExecuteS(' SELECT pa.`id_product_attribute`, pa.`id_product`, pa.`quantity`, ag.`public_name` as `group`, al.`name`, pa.`ean13`, pa.`location`, pa.`reference` FROM `'._DB_PREFIX_.'product_attribute` pa, `'._DB_PREFIX_.'product_attribute_combination` ac, `'._DB_PREFIX_.'attribute` a, `'._DB_PREFIX_.'attribute_lang` al, `'._DB_PREFIX_.'attribute_group_lang` ag WHERE pa.`id_product` = '.(int) $product->id.' AND ac.`id_product_attribute` = pa.`id_product_attribute` AND al.`id_attribute` = ac.`id_attribute` AND al.`id_lang` = '.(int) $cookie->id_lang.' AND a.`id_attribute` = al.`id_attribute` AND ag.`id_attribute_group` = a.`id_attribute_group` AND ag.`id_lang` = '.(int) $cookie->id_lang.' ORDER BY pa.`id_product` ASC, ag.`public_name` ASC, al.`name` ASC ') as $attr) { if(!isset($attributes[$attr['id_product_attribute']])) { $attributes[$attr['id_product_attribute']] = array(); } $attributes[$attr['id_product_attribute']]['name'] .= '
'.$attr['group'].' : '.$attr['name']; $attributes[$attr['id_product_attribute']]['id_product_attribute'] = $attr['id_product_attribute']; $attributes[$attr['id_product_attribute']]['ean13'] = $attr['ean13']; $attributes[$attr['id_product_attribute']]['reference'] = $attr['reference']; } $cover = Product::getCover($product->id); if(count($attributes) > 0) { foreach($attributes as $attr) { $this->_html .= ''; } } else { $this->_html .= 'ean13) ? 'class="exist" ': 'class="noexist" ').'> '; } } $this->_html .= '
'.$this->l('ID').' '.$this->l('EAN').' '.$this->l('Reference').' '.$this->l('Name').' '.$this->l('New EAN').'
'.$product->id.'
'.$attr['id_product_attribute'].'
'.(!empty($attr['ean13'])? $attr['ean13']: ''.$product->ean13).''.' '.((string) $attr['reference'] == ''? $product->reference: $attr['reference']).' '.$product->name.$attr['name'].'
'.$product->id.' '.$product->ean13.' '.$product->reference.' '.$product->name.'
'; } } $this->_html.= ''; $this->_html.= ''; $this->_html.= ''; echo $this->_html; } }