VirtueMart Forum

VirtueMart 2 + 3 + 4 => Product pricing => Topic started by: Funtshirts on June 22, 2016, 11:59:39 AM

Title: Show tax included
Post by: Funtshirts on June 22, 2016, 11:59:39 AM
Hello guys,

I would like to display the text "tax included" under my product price (without the tax amount, just the text)
IS this possible? And how would i be able to do that?

My website: www.funtshirts.nl
I use Joomla 3.5.1
php 7.0.7.
And Virtuemart 3.0.17
Title: Re: Show tax included
Post by: AH on June 22, 2016, 13:04:27 PM
You can show the sales price label  by setting this in the VM configuration and change the name given to that salesprice label using a language override to the language variable COM_VIRTUEMART_PRODUCT_SALESPRICE

OR

You can override the prices.php display  in your template and add the text you require in the position that best suits your template

\templates\YOURTEMPLATE\html\com_virtuemart\sublayouts\prices.php

Title: Re: Show tax included
Post by: jenkinhill on June 22, 2016, 13:09:49 PM
You can edit the template to add a new language constant, but I prefer to use css ::after selector to do something like this.

See  http://forum.virtuemart.net/index.php?topic=130778.msg452380#msg452380
Title: Re: Show tax included
Post by: AH on June 22, 2016, 13:33:21 PM
@jenkin

I would like to display the text "tax included" under my product price

The key part of this for my answer was "under"

I think that the use of css selector ::after  does not give you much control over the position.
Title: Re: Show tax included
Post by: GJC Web Design on June 22, 2016, 14:08:14 PM
??

span.PricesalesPrice::after {
   content: "<br />plus VAT";
}
Title: Re: Show tax included
Post by: AH on June 22, 2016, 14:53:28 PM
You cannot render HTML in the ::after or ::before selectors

You will get:

<br />plus VAT
Title: Re: Show tax included
Post by: jenkinhill on June 22, 2016, 15:22:59 PM
Use escaped A to give a line feed in css.

span.PricesalesPrice::after {
   content: "\A plus VAT";
}
Title: Re: Show tax included
Post by: Funtshirts on June 22, 2016, 16:01:28 PM
Guys thank you very much for all the replies. Very helpful.

The code i got now that works:

span.PricesalesPrice::after {
   content: "\A incl. BTW";
    font-size:x-small;
}

(incl. BTW is the Dutch translation)


Only thing i don't get to work is to get it below the price.
You already helped me out, but if someone knows how to to get it below the price, thats a bonus.
Title: Re: Show tax included
Post by: GJC Web Design on June 22, 2016, 16:09:23 PM


span.PricesalesPrice::after {
  content: "\a incl. BTW";
  white-space: pre;
font-size:x-small;
}
Title: Re: Show tax included
Post by: Funtshirts on June 22, 2016, 16:28:37 PM
Hello GJC thanks for that.

Is there a way to make the space inbetween smaller? I don't mind if its almost against the price.
If not i'll leave it as was with the previous code.
Title: Re: Show tax included
Post by: GJC Web Design on June 22, 2016, 17:54:13 PM
margin?  line-height?
Title: Re: Show tax included
Post by: Funtshirts on June 23, 2016, 16:18:02 PM
Thanks for the reply. You helped me out.

Did a lot of custom css the last few days. Maybe im starting to get the hang of it haha;)

Thanks again guys.