Ich bin blutiger PHP-Neuling und bräuchte eure Hilfe einen kleinen aber lästigen Fehler zu beheben.
Ich hoffe ihr könnt mir helfen.
Es geht um eine fehlerhafte Preisdarstellung in der Kategorieansicht
Der Fehler tritt nur dann auf, wenn alle Modelle den gleichen Preis haben und/oder wenn die Bezeichnungen der Modelle keine alphabetische Reihenfolge haben.
Produktname mit dem Fehler: "Tarro de plástico de color"
http://monpetitpot.es/tienda/envases-botes-y-frascos
PHP-Code:
<!-- PRODUCT PRICE -->
<?php if(count($this->row->prices)==1) { ?>
<?php $price=@$this->row->prices[0]; ?>
<span class="hikashop_product_price_full" style="text-align:right">
<span id="spanprice_old_<?=$product_id;?>" class="hikashop_product_price_without_discount" ><?php if(!empty($this->row->discount)){ echo $this->currencyHelper->format($price->price_value_without_discount_with_tax,$price->price_currency_id);} ?></span>
<span id="spanprice_<?=$product_id;?>" class="hikashop_product_price hikashop_product_price_0 hikashop_product_price_with_discount" > <?php echo empty($price)?JText::_('FREE_PRICE'):$this->currencyHelper->format($price->price_value_with_tax,$price->price_currency_id); ?></span> </span>
<?php
if($this->params->get('show_price','-1')=='-1'){
$config =& hikashop_config();
$this->params->set('show_price',$config->get('show_price'));
}
if($this->params->get('show_price')){
// $this->setLayout('listing_price');
// echo $this->loadTemplate();
}
?>
<?php } else { ?>
<?php
//print_r($this->row->prices);
$cnt=count($this->row->prices);
/*echo $this->row->prices[0]->price_value_with_tax;
echo $this->row->prices[1]->price_value_with_tax;*/
$numbers=array();
$numbers2=array();
for($i=0;$i<$cnt;$i++)
{
$numbers[]=@$this->row->prices[$i]->price_value_with_tax;
$numbers2[]=@$this->row->prices[$i]->price_value_without_discount_with_tax;
}
sort($numbers);
sort($numbers2);
$price=@$this->row->prices[0];
?>
<span class="hikashop_product_price_full" style="text-align:right">
<span id="spanprice_old_<?=$product_id;?>" class="hikashop_product_price_without_discount" ><?php if(!empty($this->row->discount)){ echo $this->currencyHelper->format($numbers2[0],$price->price_currency_id);} ?></span>
<span id="spanprice_<?=$product_id;?>" class="hikashop_product_price hikashop_product_price_0 hikashop_product_price_with_discount" > <?php echo empty($price)?JText::_('FREE_PRICE'):$this->currencyHelper->format($numbers[0],$price->price_currency_id); ?></span> </span>
<?php
if($this->params->get('show_price','-1')=='-1'){
$config =& hikashop_config();
$this->params->set('show_price',$config->get('show_price'));
}
if($this->params->get('show_price')){
// $this->setLayout('listing_price');
// echo $this->loadTemplate();
}
?>
<?php } ?>
<!-- EO PRODUCT PRICE -->
Auf der Produktseite funktioniert die Preisdarstellung einwandfrei.
http://monpetitpot.es/tienda/envases...stico-de-color
PHP-Code:
<!-- PRODUCT PRICE -->
<?php $price=@$this->element->prices[0]; ?>
<span class="hikashop_product_price_full" style="float:left;text-align:center;margin-left:4px;">
<?php echo JText::_( 'Precio' ); ?><br />
<span id="spanprice_<?=$product_id;?>" class="hikashop_product_price hikashop_product_price_0 hikashop_product_price_with_discount" style="margin-right:4px"> <?php echo empty($price)?JText::_('FREE_PRICE'):$this->currencyHelper->format($price->price_value_with_tax,$price->price_currency_id); ?></span> <br />
<span id="spanprice_old_<?=$product_id;?>" class="hikashop_product_price_without_discount" style="margin-right:4px"><?php if(!empty($this->element->discount)){ echo $this->currencyHelper->format($price->price_value_without_discount_with_tax,$price->price_currency_id);} ?></span>
</span>
<?php
if($this->params->get('show_price','-1')=='-1'){
$config =& hikashop_config();
$this->params->set('show_price',$config->get('show_price'));
}
if($this->params->get('show_price')){
// $this->setLayout('listing_price');
// echo $this->loadTemplate();
}
?>
<!-- EO PRODUCT PRICE -->
scharfet
Hier am Ende noch der gesamte code des fehlerhaften php files
PHP-Code:
<?php
error_reporting(0);
/**
* @package HikaShop for Joomla!
* @version 2.0.0
* @author hikashop.com
* @copyright (C) 2010-2012 HIKARI SOFTWARE. All rights reserved.
* @license GNU/GPLv3 [url]http://www.gnu.org/licenses/gpl-3.0.html[/url]
*/
defined('_JEXEC') or die('Restricted access');
?><?php
//print "<pre>";print_r($this->row);//exit;
//print "<pre>";print_r($this->image);exit;
$link = hikashop_completeLink('product&task=show&cid='.$this->row->product_id.'&name='.$this->row->alias.$this->itemid.$this->category_pathway);
if(!empty($this->row->extraData->top)) { echo implode("\r\n",$this->row->extraData->top); }
if($this->config->get('thumbnail',1)){ ?>
<!-- PRODUCT IMG -->
<div style="height:<?php echo $this->image->main_thumbnail_y;?>px;text-align:center;clear:both;" class="hikashop_product_image">
<div style="position:relative;text-align:center;clear:both;width:<?php echo $this->image->main_thumbnail_x;?>px;margin: auto;" class="hikashop_product_image_subdiv">
<?php if($this->params->get('link_to_product_page',1)){ ?>
<a href="<?php echo $link;?>" title="<?php echo $this->escape($this->row->product_name); ?>">
<?php }
echo $this->image->display(@$this->row->file_path,false,$this->escape($this->row->file_name), 'id="img_p_'.$this->row->product_id.'"' , '' , $this->image->main_thumbnail_x, $this->image->main_thumbnail_y);
$main_thumb_x = $this->image->main_thumbnail_x;
$main_thumb_y = $this->image->main_thumbnail_y;
$this->classbadge->placeBadges($this->image, $this->row->badges, -10, 0);
$this->image->main_thumbnail_x = $main_thumb_x;
$this->image->main_thumbnail_y = $main_thumb_y;
if($this->params->get('link_to_product_page',1)){ ?>
</a>
<?php } ?>
</div>
</div>
<!-- EO PRODUCT IMG -->
<?php
}
?>
<!-- PRODUCT NAME -->
<span class="hikashop_product_name">
<?php if($this->params->get('link_to_product_page',1)){ ?>
<a href="<?php echo $link;?>">
<?php }
echo $this->row->product_name;
if($this->params->get('link_to_product_page',1)){ ?>
</a>
<?php } ?>
</span>
<!-- EO PRODUCT NAME -->
<!-- PRODUCT CODE -->
<span class='hikashop_product_code_list'>
<?php if ($this->config->get('show_code')) { ?>
<a href="<?php echo $link;?>">
<?php
echo $this->row->product_code;
?>
</a>
<?php } ?>
</span>
<!-- EO PRODUCT CODE -->
<span class="hikashop_product_description">
<?php if(!empty($this->row->extraData->afterProductName)) { echo implode("\r\n",$this->row->extraData->afterProductName); } ?>
<?php if(!empty($this->row->resumenmuycorto)) { echo $this->row->resumenmuycorto; } ?>
</span>
<!-- PRODUCT VOTE -->
<?php
if($this->params->get('show_vote_product')){
$this->setLayout('listing_vote');
echo $this->loadTemplate();
}
?>
<!-- EO PRODUCT VOTE -->
<!-- PRODUCT PARAMETERS -->
<form action="<?php echo hikashop_completeLink('product&task=updatecart'); ?>" method="post" id="hikashop_product_form_<?php echo $this->row->product_id;?>" name="hikashop_product_form_<?php echo $this->row->product_id.'_'.$this->params->get('main_div_name'); ?>" enctype="multipart/form-data">
<?php //added by roberto
if (!function_exists('displayOptions')) {
?>
<script language="javascript">
function flyToElement(flyer, flyingTo, callBack ) {
var $func = jQuery(this);
var divider = 2;
var flyerClone = jQuery(flyer).clone();
jQuery(flyerClone).css({
position: 'absolute',
top: jQuery(flyer).offset().top + "px",
left: jQuery(flyer).offset().left + "px",
opacity: 1,
'z-index': 1000
});
jQuery('body').append(jQuery(flyerClone));
var gotoX = jQuery(flyingTo).offset().left + (jQuery(flyingTo).width() / 2) - (jQuery(flyer).width()/divider)/2;
var gotoY = jQuery(flyingTo).offset().top + (jQuery(flyingTo).height() / 2) - (jQuery(flyer).height()/divider)/2;
jQuery(flyerClone).animate({
opacity: 0.4,
left: gotoX,
top: gotoY,
width: jQuery(flyer).width()/divider,
height: jQuery(flyer).height()/divider
}, 700,
function () {
jQuery(flyingTo).fadeOut('fast', function () {
document.getElementById("hikashop_cart").innerHTML='<img src="/media/com_hikashop/images/loading.gif" style="height:20px"/>';
jQuery(flyingTo).fadeIn('fast', function () {
jQuery(flyerClone).fadeOut('fast', function () {
jQuery(flyerClone).remove();
if( callBack != null ) {
callBack.apply($func);
}
});
});
});
});
}
function addToCartAjax (pid) {
var posturl="<?php echo hikashop_completeLink('product&task=updatecart'); ?>";
var formid="hikashop_product_form_"+pid;
jQuery.post(posturl, jQuery('#'+formid).serialize()).done(function(data) {
var search = 'class="hikashop_cart">';
var n=data.indexOf(search);
var n2=data.indexOf("</div>",n);
if (n > 0) {
data = data.substring(n+search.length,n2);
document.getElementById("hikashop_cart").innerHTML=data;
}
});
flyToElement(jQuery("#img_p_"+pid), jQuery('#hikashop_cart'));
}
var product_qtys = new Array();
var product_vpids = new Array();
var product_prices = new Array();
var product_prices_old = new Array();
function updateProductOptions(pid,oid) {
document.getElementById("pid_"+pid).value=product_vpids[pid][oid];
document.getElementById("spanprice_"+pid).innerHTML=product_prices[pid][oid];
document.getElementById("spanprice_old_"+pid).innerHTML=product_prices_old[pid][oid];
var qty = product_qtys[pid][oid];
//alert(pid+";"+oid+";"+qty);
if (qty=='0') {
document.getElementById("divq_"+pid).style.display="none";
document.getElementById("submitp_"+pid).style.display="none";
document.getElementById("divnq_"+pid).style.display="";
} else {
var options = '<option selected value="1">1</option>';
var i = 1;
while (i < qty) {
i++;
options = options+'<option value="'+i+'">'+i+'</option>';
}
jQuery('#pqty_'+pid).children().remove().end().append(options) ;
document.getElementById("divnq_"+pid).style.display="none";
document.getElementById("divq_"+pid).style.display="";
document.getElementById("submitp_"+pid).style.display="";
}
}
</script>
<?php
function displayOptions($product_id,$map,$value,$values,$characteristic_display='dropdown'){
if(empty($values) || !is_array($values)){
return JText::_('NO_VALUES_FOUND');
}
global $characteristics;
if(is_array($characteristics)){
$characteristic_id = $map;
$map = 'hikashop_product_characteristic['.$characteristic_id.']';
$id = 'hikashop_product_characteristic_'.$characteristic_id;
}else{
$id = $map;
}
$thisvalues = array();
foreach($values as $key => $val){
if(strlen($val)!=0 && empty($val)){
$val = $val.' ';
}
$thisvalues[] = JHTML::_('select.option', $key,$val);
}
if($characteristic_display!='radio'){
$characteristic_display='generic';
}
$html = JHTML::_('select.'.$characteristic_display.'list', $thisvalues, $map, 'class="inputbox hikashop_product_options" size="1" onchange="updateProductOptions('.$product_id.',this.value);"', 'value', 'text', (int)$value,$id );
return $html;
}
}
$product_id = $this->row->product_id;
$currencyClass = hikashop_get('class.currency');
$this->assignRef('currencyHelper',$currencyClass);
$config =& hikashop_config();
$main_currency = (int)$config->get('main_currency',1);
$discount_before_tax = (int)$config->get('discount_before_tax',0);
$filters=array('a.product_id='.$product_id);
hikashop_addACLFilters($filters,'product_access','a');
$query = 'SELECT a.*, b.product_category_id, b.category_id, b.ordering FROM '.hikashop_table('product').' AS a LEFT JOIN '.hikashop_table('product_category').' AS b ON a.product_id = b.product_id WHERE '.implode(' AND ',$filters). ' LIMIT 1';
$database = JFactory::getDBO();
$database->setQuery($query);
$element = $database->loadObject();
if(empty($element)){
return;
}
if(!empty($element->product_tax_id)){
$main_tax_zone = explode(',',$config->get('main_tax_zone',''));
if(count($main_tax_zone)){
$main_tax_zone = array_shift($main_tax_zone);
}
}
//$params->set('characteristic_display',$config->get('characteristic_display','table'));
//$params->set('characteristic_display_text',$config->get('characteristic_display_text',1));
//$params->set('show_quantity_field',$config->get('show_quantity_field',1));
//$this->assignRef('params',$params);
$cart = hikashop_get('helper.cart');
$this->assignRef('cart',$cart);
$this->selected_variant_id=0;
if($element->product_type=='variant'){
$this->selected_variant_id = $product_id;
$filters=array('a.product_id='.$element->product_parent_id);
hikashop_addACLFilters($filters,'product_access','a');
$query = 'SELECT a.*,b.* FROM '.hikashop_table('product').' AS a LEFT JOIN '.hikashop_table('product_category').' AS b ON a.product_id = b.product_id WHERE '.implode(' AND ',$filters). ' ORDER BY product_category_id ASC LIMIT 1';
$database->setQuery($query);
$element = $database->loadObject();
if(empty($element)){
return;
}
$product_id = $element->product_id;
}
$productClass=hikashop_get('class.product');
$prod = new stdClass();
$prod->product_id = $product_id;
$prod->product_hit = $element->product_hit+1;
$prod->product_last_seen_date = time();
$productClass->save($prod,true);
$filters=array('a.product_id ='.$product_id,'a.product_related_type=\'options\'','b.product_published=1');
hikashop_addACLFilters($filters,'product_access','b');
$query = 'SELECT b.* FROM '.hikashop_table('product_related').' AS a LEFT JOIN '.hikashop_table('product').' AS b ON a.product_related_id = b.product_id WHERE '.implode(' AND ',$filters).' ORDER BY a.product_related_ordering ASC, a.product_related_id ASC';
$database->setQuery($query);
$element->options = $database->loadObjectList('product_id');
$ids = array($product_id);
if(!empty($element->options)){
foreach($element->options as $optionElement){
$ids[]=$optionElement->product_id;
}
}
$filters=array('product_parent_id IN ('.implode(',',$ids).')');
hikashop_addACLFilters($filters,'product_access');
$query = 'SELECT * FROM '.hikashop_table('product').' WHERE '.implode(' AND ',$filters);
$database->setQuery($query);
$variants = $database->loadObjectList();
if(!empty($variants)){
foreach($variants as $variant){
$ids[]=$variant->product_id;
if($variant->product_parent_id==$product_id){
$element->variants[$variant->product_id]=$variant;
}
if(!empty($element->options)){
foreach($element->options as $k => $optionElement){
if($variant->product_parent_id==$optionElement->product_id){
$element->options[$k]->variants[$variant->product_id] = $variant;
break;
}
}
}
}
}
$sort = $config->get('characteristics_values_sorting');
if($sort=='old'){
$order = 'characteristic_id ASC';
}elseif($sort=='alias'){
$order = 'characteristic_alias ASC';
}elseif($sort=='ordering'){
$order = 'characteristic_ordering ASC';
}else{
$order = 'characteristic_value ASC';
}
$query = 'SELECT a.*,b.* FROM '.hikashop_table('variant').' AS a LEFT JOIN '.hikashop_table('characteristic').' AS b ON a.variant_characteristic_id=b.characteristic_id WHERE a.variant_product_id IN ('.implode(',',$ids).') ORDER BY a.ordering ASC,b.'.$order;
$database->setQuery($query);
$characteristics = $database->loadObjectList();
if(!empty($characteristics)){
$mainCharacteristics = array();
foreach($characteristics as $characteristic){
if($product_id==$characteristic->variant_product_id){
$mainCharacteristics[$product_id][$characteristic->characteristic_parent_id][$characteristic->characteristic_id]=$characteristic;
}
if(!empty($element->options)){
foreach($element->options as $k => $optionElement){
if($optionElement->product_id==$characteristic->variant_product_id){
$mainCharacteristics[$optionElement->product_id][$characteristic->characteristic_parent_id][$characteristic->characteristic_id]=$characteristic;
}
}
}
}
if(!empty($element->variants)){
//$this->addCharacteristics($element,$mainCharacteristics,$characteristics);
if (function_exists('addCharacteristics'))
addCharacteristics($element,$mainCharacteristics,$characteristics);
else
$this->addCharacteristics($element,$mainCharacteristics,$characteristics);
}
if(!empty($element->options)){
foreach($element->options as $k => $optionElement){
if(!empty($optionElement->variants)){
//$this->addCharacteristics($element->options[$k],$mainCharacteristics,$characteristics);
if (function_exists('addCharacteristics'))
addCharacteristics($element->options[$k],$mainCharacteristics,$characteristics);
else
$this->addCharacteristics($element->options[$k],$mainCharacteristics,$characteristics);
if(count(@$mainCharacteristics[$optionElement->product_id][0])){
$optionsVariants = array();
$sort = $config->get('characteristics_values_sorting');
if($sort=='old'){
$order = 'characteristic_id';
}elseif($sort=='alias'){
$order = 'characteristic_alias';
}else{
$order = 'characteristic_value';
}
foreach($optionElement->variants as $k2 => $variant){
$key = '';
foreach($variant->characteristics as $char){
$key .= $char->$order.'_';
}
$optionsVariants[$key]=&$element->options[$k]->variants[$k2];
}
ksort($optionsVariants);
$element->options[$k]->variants=$optionsVariants;
}
}
}
}
}
$currency_id = hikashop_getCurrency();
if($config->get('tax_zone_type','shipping')=='billing'){
$zone_id = hikashop_getZone('billing');
}else{
$zone_id = hikashop_getZone('shipping');
}
$currencyClass->getPrices($element,$ids,$currency_id,$main_currency,$zone_id,$discount_before_tax);
//print "<pre>";print_r($element);exit;
//print_r($characteristics);//exit;
$html=$defaultid="";
$qtys = $vpids = array();
foreach($characteristics as $characteristic){
$values = array();
if(!empty($characteristic->values)){
$defaultid = $characteristic->default->characteristic_id;
foreach($characteristic->values as $k => $value){
if(!$config->get('show_out_of_stock')){
$hasQuantity = false;
foreach($element->variants as $variant){
foreach($variant->characteristics as $variantCharacteristic){
if($variantCharacteristic->characteristic_id==$value->characteristic_id){
if($variant->product_quantity != 0 || $element->product_id==$variant->product_id){
$hasQuantity = true;
}
}
}
}
if(!$hasQuantity) continue;
}
$values[$k]=$value->characteristic_value;
$vpids[$k] = $value->variant_product_id;
//$qtys[$k]=$element->variants[$k]->product_quantity;
foreach($element->variants as $variant){
foreach($variant->characteristics as $variantCharacteristic){
if($variantCharacteristic->characteristic_id==$value->characteristic_id){
if ($variant->product_quantity == -1)
$qtys[$k]=100;
else
$qtys[$k]=$variant->product_quantity;
}
}
}
}
}
if (count($values))
$html.=displayOptions($product_id,$characteristic->characteristic_id,@$characteristic->default->characteristic_id,$values,'dropdown');
}
if (!empty($html)) {
?>
<span class="hikashop_product_price_full" style="text-align:left;padding-left:4px;padding-right:4px;">
<span style="float:left;text-align:left;">
<?php echo JText::_( 'TAMANO' ); ?><br />
<?php
echo $html;
?>
<script language="javascript"><?php
echo 'product_qtys['.$product_id.']=new Array();product_vpids['.$product_id.']=new Array();product_prices['.$product_id.']=new Array();product_prices_old['.$product_id.']=new Array();'."\n";
foreach ($qtys as $key=>$value) {
echo 'product_qtys['.$product_id.']['.$key.']='.$value.';';
echo 'product_vpids['.$product_id.']['.$key.']='.$vpids[$key].';';
$vpid = $vpids[$key];
//print_r($element);exit;
$price=@$element->variants[$vpids[$key]]->prices[0];
//print_r($prices);
$price_text= empty($price)?JText::_('FREE_PRICE'):$this->currencyHelper->format($price->price_value_with_tax,$price->price_currency_id);
echo 'product_prices['.$product_id.']['.$key.']=\''.$price_text.'\';';
$price_text = '';
if(!empty($element->variants[$vpids[$key]]->discount)){ $price_text=$this->currencyHelper->format($price->price_value_without_discount_with_tax,$price->price_currency_id);}
echo 'product_prices_old['.$product_id.']['.$key.']=\''.$price_text.'\';';
}
?></script>
<?php
//print_r($qtys);
//print $defaultid;
?>
</span>
<span id="divq_<?=$product_id;?>" style="float:right;text-align:right;<?=($qtys[$defaultid]=="0")?"display:none":"";?>"><?php echo JText::_( 'CANTIDAD' ); ?><br /><select id="pqty_<?=$product_id;?>" name="quantity" style="width:65px"><option selected value="1">1</option><?php
$i=1;
while ($i<$qtys[$defaultid]) {
$i++;
echo '<option value='.$i.'>'.$i.'</option>';
}
?></select></span>
<span id="divnq_<?=$product_id;?>" style="float:right;<?=($qtys[$defaultid]!="0")?"display:none":"";?>"><br/><div style="background-color:#ce5d42;color:#fff;padding-left:10px;padding-right:10px;height:18px;font-size:13px;line-height:130%;">Sin Stock</div></span>
</span><br style="clear:both" />
<?php
} else {
$qty = @$this->row->product_quantity;
if ($qty == -1) $qty=12;
?>
<span class="hikashop_product_price_full">
<span id="divq_<?=$product_id;?>" style="float:right;text-align:right;<?=($qtys=="0")?"display:none":"";?>"><?php echo JText::_( 'CANTIDAD' ); ?><br /><select id="pqty_<?=$product_id;?>" name="quantity" style="width:65px"><option selected value="1">1</option><?php
$i=1;
while ($i<$qty) {
$i++;
echo '<option value='.$i.'>'.$i.'</option>';
}
?></select></span>
<span id="divnq_<?=$product_id;?>" style="float:right;<?=($qty!="0")?"display:none":"";?>"><br/><div class="sin_stock">Sin Stock</div></span>
</span><br style="clear:both" />
<?php
}
//exit;
?>
<!-- EO PRODUCT PARAMETERS -->
<?php ?>
<!-- PRODUCT PRICE -->
<?php if(count($this->row->prices)==1) { ?>
<?php $price=@$this->row->prices[0]; ?>
<span class="hikashop_product_price_full" style="text-align:right">
<span id="spanprice_old_<?=$product_id;?>" class="hikashop_product_price_without_discount" ><?php if(!empty($this->row->discount)){ echo $this->currencyHelper->format($price->price_value_without_discount_with_tax,$price->price_currency_id);} ?></span>
<span id="spanprice_<?=$product_id;?>" class="hikashop_product_price hikashop_product_price_0 hikashop_product_price_with_discount" > <?php echo empty($price)?JText::_('FREE_PRICE'):$this->currencyHelper->format($price->price_value_with_tax,$price->price_currency_id); ?></span> </span>
<?php
if($this->params->get('show_price','-1')=='-1'){
$config =& hikashop_config();
$this->params->set('show_price',$config->get('show_price'));
}
if($this->params->get('show_price')){
// $this->setLayout('listing_price');
// echo $this->loadTemplate();
}
?>
<?php } else { ?>
<?php
//print_r($this->row->prices);
$cnt=count($this->row->prices);
/*echo $this->row->prices[0]->price_value_with_tax;
echo $this->row->prices[1]->price_value_with_tax;*/
$numbers=array();
$numbers2=array();
for($i=0;$i<$cnt;$i++)
{
$numbers[]=@$this->row->prices[$i]->price_value_with_tax;
$numbers2[]=@$this->row->prices[$i]->price_value_without_discount_with_tax;
}
sort($numbers);
sort($numbers2);
$price=@$this->row->prices[0];
?>
<span class="hikashop_product_price_full" style="text-align:right">
<span id="spanprice_old_<?=$product_id;?>" class="hikashop_product_price_without_discount" ><?php if(!empty($this->row->discount)){ echo $this->currencyHelper->format($numbers2[0],$price->price_currency_id);} ?></span>
<span id="spanprice_<?=$product_id;?>" class="hikashop_product_price hikashop_product_price_0 hikashop_product_price_with_discount" > <?php echo empty($price)?JText::_('FREE_PRICE'):$this->currencyHelper->format($numbers[0],$price->price_currency_id); ?></span> </span>
<?php
if($this->params->get('show_price','-1')=='-1'){
$config =& hikashop_config();
$this->params->set('show_price',$config->get('show_price'));
}
if($this->params->get('show_price')){
// $this->setLayout('listing_price');
// echo $this->loadTemplate();
}
?>
<?php } ?>
<!-- EO PRODUCT PRICE -->
<!-- ADD TO CART BUTTON AREA -->
<?php if(($this->row->product_quantity==0) && ($this->row->prices[0]->product_quantity==0)) { } else {?>
<input id="submitp_<?=$product_id;?>" type="image" src="/media/com_hikashop/images/add_to_cart.png" value="Add to Cart" style="float:right" onclick="addToCartAjax(<?=$this->row->product_id;?>);return false;" />
<?php } ?>
<div class="hikashop_product_details_link" onclick="window.location.href='<?=$link;?>'">+ Detalles</div>
<input type="hidden" name="hikashop_cart_type_<?php echo $this->row->product_id; ?>" id="hikashop_cart_type_<?php echo $this->row->product_id; ?>" value="cart"/>
<input id="pid_<?=$this->row->product_id;?>" type="hidden" name="product_id" value="<?=(!empty($defaultid) && !empty($vpids[$defaultid]))?$vpids[$defaultid]:$this->row->product_id; ?>" />
<input type="hidden" name="add" value="1"/>
<input type="hidden" name="ctrl" value="product"/>
<input type="hidden" name="task" value="updatecart"/>
<input type="hidden" name="return_url" value="<?php echo urlencode(base64_encode(urldecode($this->redirect_url)));?>"/>
</form>
<?php
if($this->params->get('add_to_cart') || $this->params->get('add_to_wishlist')){
// $this->setLayout('add_to_cart_listing');
// echo $this->loadTemplate();
// roberto changes end
}?>
<!-- EO ADD TO CART BUTTON AREA -->
<!-- COMPARISON AREA -->
<?php
if(JRequest::getVar('hikashop_front_end_main',0) && JRequest::getVar('task')=='listing' && $this->params->get('show_compare')) { ?>
<br/><?php
if( $this->params->get('show_compare') == 1 ) {
?>
<a class="hikashop_compare_button" href="<?php echo $link;?>" onclick="setToCompareList(<?php echo $this->row->product_id;?>,'<?php echo $this->escape($this->row->product_name); ?>',this); return false;"><?php echo JText::_('ADD_TO_COMPARE_LIST'); ?></a>
<?php } else { ?>
<input type="checkbox" class="hikashop_compare_checkbox" id="hikashop_listing_chk_<?php echo $this->row->product_id;?>" onchange="setToCompareList(<?php echo $this->row->product_id;?>,'<?php echo $this->escape($this->row->product_name); ?>',this);"><label for="hikashop_listing_chk_<?php echo $this->row->product_id;?>"><?php echo JText::_('ADD_TO_COMPARE_LIST'); ?></label>
<?php }
} ?>
<!-- EO COMPARISON AREA -->
<?php if(!empty($this->row->extraData->bottom)) { echo implode("\r\n",$this->row->extraData->bottom); } ?>
Einen Kommentar schreiben: