VirtueMart Forum

VirtueMart 2 + 3 + 4 => Product pricing => Topic started by: djdlife on March 19, 2016, 16:16:36 PM

Title: Discount Price
Post by: djdlife on March 19, 2016, 16:16:36 PM
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']<=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
Title: Re: Discount Price
Post by: Studio 42 on March 20, 2016, 14:54:56 PM
I cannot rememeber the post, but this question is already in the forum
Title: Re: Discount Price
Post by: djdlife on March 22, 2016, 22:21:02 PM
no budy any idea?

Title: Re: Discount Price
Post by: GJC Web Design on March 22, 2016, 23:12:56 PM
Yes.. you search the forum.. has been answered before....