Hello
I have a question. How can I show the price, if the product discount like so:
Old Price: CHF 45.00
New Price: CHF 22.50
and if the product not discount then like so:
CHF 45.00
Now it show so:
https://www.dropbox.com/s/cbnptthd2xohvf9/Bildschirmfoto%202016-03-19%20um%2016.12.26.png?dl=0
By the old website change someone this(Virtuemart 2.0.24) and look like so:
https://www.dropbox.com/s/m8rnut4pkbcjw0o/Bildschirmfoto%202016-03-19%20um%2016.13.11.png?dl=0
This is the code from the old website:
<?php
/**
*
* Show the product details page
*
* @package VirtueMart
* @subpackage
* @author Max Milbers, Valerie Isaksen
* @link http://www.virtuemart.net
* @copyright Copyright (c) 2004 - 2010 VirtueMart Team. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* VirtueMart is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses.
* @version $Id: default_showprices.php 6556 2012-10-17 18:15:30Z kkmediaproduction $
*/
// Check to ensure this file is included in Joomla!
defined ('_JEXEC') or die('Restricted access');
?>
<div class="product-price" id="productPrice<?php echo $this->product->virtuemart_product_id ?>">
<?php
if (!empty($this->product->prices['salesPrice'])) {
echo "<strong>" . JText::_ ('COM_VIRTUEMART_CART_PRICE') . "</strong>";
}
//vmdebug('view productdetails layout default show prices, prices',$this->product);
if ($this->product->prices['salesPrice']<=0 and VmConfig::get ('askprice', 1) and isset($this->product->images[0]) and !$this->product->images[0]->file_is_downloadable) {
?>
<a class="ask-a-question bold" href="<?php echo $this->askquestion_url ?>" rel="nofollow" ><?php echo JText::_ ('COM_VIRTUEMART_PRODUCT_ASKPRICE') ?></a><?php
if(!empty($this->product->prices['discountAmount']))
{
echo $this->currency->createPriceDiv('basePrice', '', $this->product->prices);
echo $this->currency->createPriceDiv('salesPrice', '', $this->product->prices);
} else {
echo $this->currency->createPriceDiv('salesPrice', 'COM_VIRTUEMART_PRODUCT_SALESPRICE', $this->product->prices);
}
} else {
if(!empty($this->product->prices['discountAmount']))
{
echo $this->currency->createPriceDiv('basePrice', '', $this->product->prices);
//var_dump($this);
echo "<font class='aktion'>".$this->currency->createPriceDiv('salesPrice', '', $this->product->prices)."</font>";
//echo $this->currency->createPriceDiv('discountAmount', 'COM_VIRTUEMART_PRODUCT_DISCOUNT_AMOUNT', $this->product->prices);
} else {
echo $this->currency->createPriceDiv('salesPrice', 'COM_VIRTUEMART_PRODUCT_SALESPRICE', $this->product->prices);
}
$unitPriceDescription = JText::sprintf ('COM_VIRTUEMART_PRODUCT_UNITPRICE', JText::_('COM_VIRTUEMART_UNIT_SYMBOL_'.$this->product->product_unit));
echo $this->currency->createPriceDiv ('unitPrice', $unitPriceDescription, $this->product->prices);
}
?>
</div>
I have for the new website the version Virtuemart 3.0.14 with Joomla 3.4.8
Thanks and best regards
I cannot rememeber the post, but this question is already in the forum
no budy any idea?
Yes.. you search the forum.. has been answered before....