VirtueMart Forum

VirtueMart 2 + 3 + 4 => Templating & Layouts => Topic started by: grimmari on December 12, 2015, 19:36:27 PM

Title: Stylin product price
Post by: grimmari on December 12, 2015, 19:36:27 PM
Hi!

How I can change text color in product price.
I can change how it displaying by modify sublayout files but I can not understan how I can make like:
sell price is firs - Bold text
discount price is second and color is red and type is bold.

I try to make own div class but I not take effect like changing
echo '<div class="vm-cart-price">' . $currency->createPriceDiv ('salesPrice', 'COM_VIRTUEMART_PRODUCT_SALESPRICE', $product->prices) . '</div' ;
to
echo '<div class="own">' . $currency->createPriceDiv ('salesPrice', 'COM_VIRTUEMART_PRODUCT_SALESPRICE', $product->prices) . '</div' ;

and then I add own class in v,-ltr-common.css file

But nothing chanfed
Title: Re: Stylin product price
Post by: grimmari on December 12, 2015, 21:01:56 PM
Now I get changed color and text style in product detail view but not in category display view...
Title: Re: Stylin product price
Post by: jenkinhill on December 12, 2015, 23:36:16 PM
If you are using VM default templates and you check with  Firebug then you can see that each type of price already is given a class which can be used for styling with css override.
These are some of the classes used:
PricebasePriceVariant
PricesalesPrice
PricepriceWithoutTax
PricetaxAmount
Title: Re: Stylin product price
Post by: grimmari on December 13, 2015, 09:30:22 AM
So, i try to find text string PricetaxAmount in my files but there is not any items anywhere...
I use vm 3.0.12
or do you men I have to make these classes to css?
Title: Re: Stylin product price
Post by: jenkinhill on December 13, 2015, 11:23:49 AM
If you use VM default templates the classes are already there, so all you have to do is apply css overrides to style them as you wish.

You have not stated if you already use template overrides - or even what version(s) you are using, but these classes used in the default templates make styling of output very easy.
Title: Re: Stylin product price
Post by: grimmari on December 13, 2015, 12:05:47 PM
I extract vm package in test directory and try find class PricebasePrice no result. I can see it in firebug (PricebasePrice1211) but where I can set parameter?? now is something what I dont understand...
Title: Re: Stylin product price
Post by: grimmari on December 13, 2015, 12:38:54 PM
Ok, now i get it to take effect reason why i dot get it before is that I dont use div. parameter in css owerride file. But it stil dont change category vien fonts....
Title: Re: Stylin product price
Post by: grimmari on December 13, 2015, 13:10:46 PM
solved... there is also color parameter in vm-ltr-common.css file (line 144) when i remove color in there, all look fine.
Title: Re: Stylin product price
Post by: jenkinhill on December 13, 2015, 13:55:48 PM
Make sure you use a css override, or the changes will be lost after the next VM update. The next version, VM3.0.12.2 will be available soon.