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

Show only sales price not msrp when no discounts

Started by websmith, November 19, 2016, 05:21:55 AM

Previous topic - Next topic

websmith

VM 1.0.18.1
Joomla 3.6.4

I currently have an msrp or retail price displayed in my product details page along with discount and sales price.
This works great for majority of products but there are also a bunch that have no discount.
So now for those products I have a msrp or retail price, and I also have a sales prices which is the same since there should no discount.

Id like to just show sales price and not msrp or retail price of possible since there's no discount. Just seems redundant to show msrp price and sales price if they are both the same with no discount.
Hope this makes sense

Ghost

Create an override of prices.php sublayout and check if base/sale price is the same before showing base price, e.g.:

if ($product->prices['basePrice'] != $product->prices['salesPrice']) echo $currency->createPriceDiv ('basePrice', 'COM_VIRTUEMART_PRODUCT_BASEPRICE', $product->prices);

websmith

Thanks Ghost for the reply and example. Ive tried creating an override and editing the prices.php directly and it doesnt seem to change the pricing display. Still shows both base price ans sales price. ??

Jörgen

Hello

Are You making the Changes in the right file ? You should make the Changes in :

your_template/html/com_virtuemart/sublayouts/products.php

Test with some debug statements
vmdebug(' this is my baseprice', $product->prices['basePrice']);

to see what is going on  8)

Don´t forget to turn on debug display.

regards

Jörgen  @ Kreativ Fotografi
Joomla 3.9.18
Virtuemart 3.4.x
Olympiantheme Hera (customized)
This reflects current status when viewing old post.