News:

Looking for documentation? Take a look on our wiki

Main Menu

Stylin product price

Started by grimmari, December 12, 2015, 19:36:27 PM

Previous topic - Next topic

grimmari

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

grimmari

#1
Now I get changed color and text style in product detail view but not in category display view...

jenkinhill

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
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

grimmari

#3
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?

jenkinhill

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.
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

grimmari

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...

grimmari

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....

grimmari

solved... there is also color parameter in vm-ltr-common.css file (line 144) when i remove color in there, all look fine.

jenkinhill

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.
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