setLayout('listing_price'); $old_show_discount = $this->params->get('show_discount'); $this->params->set('show_discount',0); $i=0; $js="var hikashop_options=Array();"; 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)){ $this->values[] = JHTML::_('select.option', 0,JText::_('HIKA_NONE')); $text = $optionElement->product_name; $this->row =& $optionElement; if(!empty($optionElement->prices)){ $ok = 0; foreach($optionElement->prices as $k => $price){ if(empty($price->price_min_quantity)){ $ok = $k; break; } } $this->row->prices = array($optionElement->prices[$k]); $text.=' ( + '.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."]=".$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){ if(empty($variant->variant_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)){ $ok = 0; foreach($variant->prices as $k => $price){ if(empty($price->price_min_quantity)){ $ok = $k; break; } } $this->row->prices = array($variant->prices[$k]); $text.=' ( + '.strip_tags($this->loadTemplate()).' )'; 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."]=".$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,$text); } } $html = JHTML::_('select.genericlist', $this->values, $map, 'class="inputbox" size="1" onchange="hikashopChangeOption();"', 'value', 'text', (int)$value,$id ); if(!empty($optionElement->variants)){ $optionElements=''; if(!empty($optionElement->main->product_description) || !empty($optionElement->main->product_url)){ $optionElements='Information'; $description = ''; if(!empty($optionElement->main->product_description)){ $description = strip_tags(JHTML::_('content.prepare',$optionElement->main->product_description)); $optionElements=''.$optionElements.''; } if(!empty($optionElement->main->product_url)){ JHTML::_('behavior.modal'); if(empty($description)){ $description = $optionElement->main->product_name; } $optionElements=''.$optionElements.''; } } $html=''.$optionElement->main->product_name.$optionElements.'addScriptDeclaration(""); $this->params->set('show_discount',$old_show_discount); ?>
'.$html; } ?>