VirtueMart Forum

VirtueMart 2 + 3 + 4 => Templating & Layouts => Topic started by: websmith on April 14, 2016, 14:31:08 PM

Title: How to Rearrange order of base price, sales price and discount
Post by: websmith on April 14, 2016, 14:31:08 PM
VM 3.0.16
Joomla 3.5.1

Is there a way to rearrange the order of a products label pricing? My products currently display Base price, then sales price then discount. I think it would be better to display Base price, then discount then sales price.

Would the "rounding digits" on pricing configuration page set the order of the price labels chosen? I thought I would ask here first to make sure. Thanks again for any suggestions.
Title: Re: How to Rearrange order of base price, sales price and discount
Post by: jenkinhill on April 14, 2016, 14:51:32 PM
You can rearrange the layout by editing and overriding components/com_virtuemart/sublayouts/prices.php  - or if you already use overrides, by editing templates/YourJoomlaTemplate/html/com_virtuemart/sublayouts/prices.php

Rounding is not related to the order of prices, just the numerical display of each.
Title: Re: How to Rearrange order of base price, sales price and discount
Post by: websmith on April 25, 2016, 19:02:01 PM
Can I post the code I have from this page and maybe someone can help show me where to make the edit? I can usually kind of decipher some coding but this I have no clue. The few tries I made only made the discount disappear.
You can rearrange the layout by editing and overriding components/com_virtuemart/sublayouts/prices.php  -

I do not have this overrides.
or if you already use overrides, by editing templates/YourJoomlaTemplate/html/com_virtuemart/sublayouts/prices.php
Title: Re: How to Rearrange order of base price, sales price and discount
Post by: GJC Web Design on April 25, 2016, 23:20:45 PM
its not complicated

u don't need to understand what it is doing.. it is just a series of echoed statements some surrounded by if statements

each one is a price display

they start at line 42 if prices present

this is the sales price
echo $currency->createPriceDiv ('salesPrice', 'COM_VIRTUEMART_PRODUCT_SALESPRICE', $product->prices);

this is the discount

echo $currency->createPriceDiv ('discountAmount', 'COM_VIRTUEMART_PRODUCT_DISCOUNT_AMOUNT', $product->prices);

this is the tax

echo $currency->createPriceDiv ('taxAmount', 'COM_VIRTUEMART_PRODUCT_TAX_AMOUNT', $product->prices);

if those are enabled in the admin they show