News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

how to display discount price for items with discoun only

Started by cerhio, December 15, 2012, 21:51:00 PM

Previous topic - Next topic

cerhio

Hi everybody!

I cannot find proper configuration settings.

I want to display old price and discount price only for the items, where discount is set. If there is now discount only real price value is dispayed.

Thank you!

randomdev

#1
There is no configuration for this.

If you like you can copy
components\com_virtuemart\views\productdetails\tmpl\default.php

to
templates\yourtemplatesname\html\com_virtuemart\productdetails\default.php (assuming this doesnt already exist)

Then edit the price display line something like this:

if (round($this->product->prices['basePriceWithTax'],VmConfig::get('salesPriceRounding')) != $this->product->prices['salesPrice']) {
echo '<span class="price-crossed" >' . $this->currency->createPriceDiv ('basePriceWithTax', 'COM_VIRTUEMART_PRODUCT_BASEPRICE_WITHTAX', $this->product->prices) . "</span>";
}


instead of just

echo '<span class="price-crossed" >' . $this->currency->createPriceDiv ('basePriceWithTax', 'COM_VIRTUEMART_PRODUCT_BASEPRICE_WITHTAX', $this->product->prices) . "</span>";


I just realised the default price display of virtuemart is a bit different now so you may need to do the same as above but with default_showprices.php instead of default.php

bytelord

Also if you search the forum you will find a lot of similar posts from me and others...

Use firebug to examine you site code and css styling: https://forum.virtuemart.net/index.php?topic=102850.0

Template Overrides:
Creating Template overrides: https://forum.virtuemart.net/index.php?topic=98505.0
Template System: https://dev.virtuemart.net/projects/virtuemart/wiki/Hints_for_the_use_of_the_template_system

Regards
Production: Joomla 2.5.8 | VM 2.0.14 | PHP 5.3.13
Testing     : Joomla 2.5.8 | VM 2.0.16 | PHP 5.3.8
Testing     : Joomla 2.5.8 |    VM 2.1   | PHP 5.3.8

- Don't Forget to mark thread as solved when it is solved!
- Please do not PM with support questions, use the forum!