Hi, after reading other topics I am trying to display the Original price and sales price (including discount)
on one line, instead below each other.
I used this code in currencydisplay.php on administrator/components/com_virtuemart/helpers to display the discounted price only if there is a discount. :
// ==
// Añadimos código
// ==
// Comprobamos que sea un descuento
if ($name == "discountAmount" && $vis == "none")
{
// Si el descuento está vacío (discountAmount) (display: none). Obtenemos una cadena vacía en lugar de un div
return "";
}
// Si hay descuento y queremos mostrar el precio con impuestos (PriceWithTax)
if ($name == "basePriceWithTax")
{
// Comprobamos que haya descuento
if(!empty($product_price['discountAmount']))
{
$vis = "block";
//Vamos a darle formato al precio
$priceFormatted = $this->priceDisplay($price,0,(float)$quantity,false,$this->_priceConfig[$name][1] );
// Existe descuento y mostramos el precio con impuestos (PriceWithTax) y aplicamos los nuevos estilos
$css = "red";
return '<div class="Price'.$name.'" style="display : '.$vis.';" >'.$descr.'<span class="Price'.$name.' '.$css.'" >'.$priceFormatted.'</span></div>';
}
else {
$priceFormatted = '';
$vis = "none";
return '<div class="Price'.$name.'" style="display : '.$vis.';" >'.$descr.'<span class="Price'.$name.' '.$css.'" >'.$priceFormatted.'</span></div>';
}
}
// ==
// Fin código
// ==
In default.php in template folder /com_virtuemart/category/ I added this line of code:
Quoteif ($this->currency->createPriceDiv('discountAmount','COM_VIRTUEMART_PRODUCT_DISCOUNT_AMOUNT',$product->prices)) {
echo $this->currency->createPriceDiv('basePriceWithTax','',$product->prices) . $this->currency->createPriceDiv('salesPrice', '', $product->prices); }
It is al working, but... I like both prices on one line and not below each other. I guess it's because it's creating a separate div for each price.
Does any have a solution for this?