VirtueMart Forum

VirtueMart 2 + 3 + 4 => Product pricing => Topic started by: Gingerweb on July 16, 2015, 11:48:43 AM

Title: Possible to show £650 + VAT ?
Post by: Gingerweb on July 16, 2015, 11:48:43 AM
It is obviously easy to create a language override for the text before the price - but how can i set the text  " plus VAT" after the total price please ?
thanks
Title: Re: Possible to show £650 + VAT ?
Post by: jenkinhill on July 16, 2015, 12:51:27 PM
You can do that using template overrides. How exactly depends on your versions and what template you are using. 

http://forum.virtuemart.net/index.php?topic=79799.0
Title: Re: Possible to show £650 + VAT ?
Post by: Gingerweb on July 16, 2015, 16:38:46 PM
thanks - i am using VirtueMart 3.0.6.2  and Joomla 3.4.3
i can PM you a login as the site is offline if you need it ?

many thanks
Title: Re: Possible to show £650 + VAT ?
Post by: Gingerweb on August 10, 2015, 11:19:28 AM
just a reminder if you have a moment to help me with this ?
thanks
Title: Re: Possible to show £650 + VAT ?
Post by: jenkinhill on August 20, 2015, 13:26:06 PM
Coming back to this after holidays, ignore this if you already worked it out, but you say you want to add Plus VAT after the price total, so I assume that is in the cart layout.

THis is just one way to do it:
Make a template override for components/com_virtuemart/views/cart/tmpl/default_pricelist.php     This file uses a table to lay out the data.

Find

<td align="right"><strong><?php echo $this->currencyDisplay->createPriceDiv ('billTotal'''$this->cart->cartPrices['billTotal'], FALSE); ?></strong></td>
</tr>

and change to

<td align="right"><strong><?php echo $this->currencyDisplay->createPriceDiv ('billTotal'''$this->cart->cartPrices['billTotal'], FALSE); ?></strong></td><td> Plus VAT</td>
</tr>


Then add a <br></br>  just before each of the </tr> tags appearing above the edited line on the template.

If you are using more than one language the don't use "Plus VAT" in the template, but make a language override for that phrase in each of the languages you use, and use the language constant in the relevant <td>
Title: Re: Possible to show £650 + VAT ?
Post by: Gingerweb on August 20, 2015, 13:33:12 PM
Hope you had a fab holidays and thanks for this, i actually want to be able to show this in the product

it currently says : Total + Vat: £28.99

and i want it to say £28.99 plus VAT

hope this is simple!
cheers
Title: Re: Possible to show £650 + VAT ?
Post by: jenkinhill on August 20, 2015, 15:26:39 PM
In that case you need to override components/com_virtuemart/sublayouts/prices.php
Title: Re: Possible to show £650 + VAT ?
Post by: Gingerweb on August 30, 2015, 11:11:48 AM
Thanks - can you tell me which part of the prices.php file i need to edit please, i have tried a few options but am messing it up each time !
many thanks
Title: Re: Possible to show £650 + VAT ?
Post by: jenkinhill on August 31, 2015, 14:07:20 PM
I just used an alternative method for a client whose prices sublayout structure prevented changing the override. In this case it was a simple css solution, and it may be easier for you to understand.

eg this adds plus VAT after the Sales Price:

span.PricesalesPrice::after {
   content: " plus VAT";
}

or to add it after the Discount amount:

span.PricediscountAmount::after {
   content: " plus VAT";
}

Just look at the page output code to determine which class to use for each line where you want plus VAT to appear.

Use the added css in an override for vm-ltr-site.css  - see docs,   http://docs.virtuemart.net/tutorials/templating-layouts/106-override-vmsite-ltr-css.html
Title: Re: Possible to show £650 + VAT ?
Post by: Gingerweb on August 31, 2015, 15:00:36 PM
That is massively easier and works a treat - many thanks  ;D ;D ;D