News:

Support the VirtueMart project and become a member

Main Menu

Possible to show £650 + VAT ?

Started by Gingerweb, July 16, 2015, 11:48:43 AM

Previous topic - Next topic

Gingerweb

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

jenkinhill

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
Kelvyn
Lowestoft, Suffolk, UK

Retired from forum life November 2023

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

Gingerweb

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

Gingerweb

just a reminder if you have a moment to help me with this ?
thanks

jenkinhill

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>
Kelvyn
Lowestoft, Suffolk, UK

Retired from forum life November 2023

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

Gingerweb

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

jenkinhill

In that case you need to override components/com_virtuemart/sublayouts/prices.php
Kelvyn
Lowestoft, Suffolk, UK

Retired from forum life November 2023

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

Gingerweb

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

jenkinhill

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
Kelvyn
Lowestoft, Suffolk, UK

Retired from forum life November 2023

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

Gingerweb

That is massively easier and works a treat - many thanks  ;D ;D ;D