setLayout('listing_price'); $old_show_discount = $this->params->get('show_discount'); $old_per_unit = $this->params->get('per_unit',1); $this->params->set('show_discount',0); $this->params->set('per_unit',0); $this->params->set('from_module','1'); $i=0; $js="var hikashop_options=Array();"; $image_path= $this->image->uploadFolder_url; $js = $js.'var nb_option = '.count($this->element->options).';'; foreach($this->element->options as $optionElement){ ?> values = array(); $value = 0; $currency = hikashop_get('class.currency'); $map = 'hikashop_product_option['.$i.']'; $id = 'hikashop_product_option_'.$i; if(empty($optionElement->variants)){ if(!$optionElement->product_published || (!$this->config->get('show_out_of_stock',1) && $optionElement->product_quantity==0)) continue; $this->values[] = JHTML::_('select.option', 0,JText::_('HIKASHOP_NO')); $text = JText::_('HIKASHOP_YES'); $this->row =& $optionElement; if(!empty($optionElement->prices) && $this->params->get('show_price')){ $ok = 0; $positive=1; foreach($optionElement->prices as $k => $price){ if(empty($price->price_min_quantity)){ $ok = $k; if($price->price_value<0) $positive=false; break; } } $this->row->prices = array($optionElement->prices[$k]); $text.=' ( '.($positive?'+ ':'').strip_tags($this->loadTemplate()).' )'; if($this->params->get('price_with_tax')){ $price = $optionElement->prices[$k]->price_value_with_tax; }else{ $price = $optionElement->prices[$k]->price_value; } $js.=" hikashop_options[".(int)$optionElement->product_id."]=".(float)$price.";"; } $this->values[] = JHTML::_('select.option', $optionElement->product_id,$text); }else{ $defaultValue=array(); if(isset($optionElement->characteristics) && is_array($optionElement->characteristics) && count($optionElement->characteristics)){ foreach($optionElement->characteristics as $char){ $defaultValue[]=$char->characteristic_id; } } foreach($optionElement->variants as $variant){ $image_src=''; if(isset($variant->images)) { //$code = $variant->product_code; //$image_big = $image_path.$code.'.png'; $product_name = $variant->product_name; $i_vl=0; while($variant->images[$i_vl]){ $image = $variant->images[$i_vl]; if($image->file_ordering == 0){ $image_small = $image_path.$image->file_path; $image_name = substr($image_small, 0, -4); $image_big = $image_name.'.png'; $image_src = '
product_id.'-div\' class=\'choix_couleur\' onmouseover="onchoixCouleurs(\''.$image_big.'\',\''.$product_name.'\');" onmouseout="outchoixCouleurs(\''.$image_big.'\');" > '.$image->file_name .'
'; break; } $i_vl++; } //$image_src = 'src="'.$image_path.$image->file_path. '" height=30px/>'; //$js .= 'style ="background: url('.$image_src.') no-repeat"'; } if(!$variant->product_published || (!$this->config->get('show_out_of_stock',1) && empty($variant->product_quantity))) continue; if($variant->product_sale_start>time()) continue; if($variant->product_sale_end!='' && $variant->product_sale_end!='0' && $variant->product_sale_endvariant_name)){ if(empty($variant->characteristics_text)){ $text = $variant->product_name; }else{ $text = $variant->characteristics_text; } }else{ $text = $variant->variant_name; } $this->row =& $variant; if(empty($variant->prices)){ $js.="hikashop_options[".(int)$variant->product_id."]=0;"; } if(!empty($variant->prices) && $this->params->get('show_price')){ $ok = 0; $positive=1; foreach($variant->prices as $k => $price){ if(empty($price->price_min_quantity)){ $ok = $k; if($price->price_value<0) $positive=false; break; } } $this->row->prices = array($variant->prices[$k]); $text.=' ( '.($positive?'+ ':'').strip_tags($this->loadTemplate()).' )'; /* permet d'enlever le prix dans la liste si il est égal à 0.00*/ /* modifier vl*/ $text1=''; $verify_price = ''; $w=0; $text_length = strlen($text); for($w; $w<$text_length ;$w++){ if($text[$w] != '('){ $text1.= $text[$w]; }else{ $verify_price .=$text[$w+10].$text[$w+12].$text[$w+13]; break; } } if($verify_price == '000') $text = $text1; /* fin vl*/ if($this->params->get('price_with_tax')){ $price = $variant->prices[$k]->price_value_with_tax; }else{ $price = $variant->prices[$k]->price_value; } $js.=" hikashop_options[".(int)$variant->product_id."]=".(float)$price.";"; } //fin if price if($defaultValue && isset($variant->characteristics) && is_array($variant->characteristics) && count($variant->characteristics)){ $default = true; foreach($variant->characteristics as $char){ if(!in_array($char->characteristic_id,$defaultValue)){ $default = false; } } if($default){ $value = $variant->product_id; } } $this->values[] = JHTML::_('select.option', $variant->product_id,$image_src); } } if(!count($this->values)) continue; $html = JHTML::_('select.radiolist', $this->values, $map, 'class="inputbox option_couleur" size="1" onchange="hikashopChangeOption();" ', 'value', 'text', (int)$value,$id ); if(!empty($optionElement->variants)){ $optionInfo =& $optionElement->main; }else{ $optionInfo =& $optionElement; } $options=''; if(!empty($optionInfo->product_description) || !empty($optionInfo->product_url)){ $options='Information'; $description = ''; if(!empty($optionInfo->product_description)){ $description = $this->escape(strip_tags(JHTML::_('content.prepare',$optionInfo->product_description))); $options=''.$options.''; } if(!empty($optionInfo->product_url)){ JHTML::_('behavior.modal'); if(empty($description)){ $description = $optionInfo->product_name; } $options=''.$options.''; } //vl option descrption $options = ' ('.$this->escape(strip_tags(JHTML::_('content.prepare',$optionInfo->product_description))).')'; } $html=''.$optionInfo->product_name.$options.''; ?> addScriptDeclaration("\n\n"); $this->params->set('show_discount',$old_show_discount); $this->params->set('per_unit',$old_per_unit); $this->params->set('from_module',''); ?>
'.$html; ?>