News:

Looking for documentation? Take a look on our wiki

Main Menu

Formatting prices on product pages but not the cart page

Started by chrisnz, August 16, 2013, 00:30:18 AM

Previous topic - Next topic

chrisnz

When I format the prices using CSS for the product detail page (.PricesalesPrice, .PricediscountAmount etc)  the formatting is also applied to these prices on the cart page but I cannot see where to stop this from happening. On the product detail pages I want the price nice and big, but just standard size on the cart page.
Thanks for your help

jenkinhill

Edit one of the price display templates (or both) to add an additional class or id to more accurately apply your styles. Unless you are already using overrides the templates are
components/com_virtuemart/views/productdetails/tmpl/default_showprices.php
components/com_virtuemart/views/cart/tmpl/default_pricelist.php

Be sure to use the edited files as template overrides so that they are preserved during VM updates.
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

chrisnz

Thanks - yes I am using template overrides and was expecting to be able to apply a different class in the default_pricelist.php template. I'm pretty comfortable with CSS but not so much with php. The code in question would be around line 210

echo $this->currencyDisplay->createPriceDiv ('salesPrice', '', $this->cart->pricesUnformatted[$pkey], FALSE, FALSE, $prow->quantity) ?>

but I can't see how to apply a different class as the .PricesalesPrice class seems to be dynamically generated

Maxim Pishnyak

I need a link to help you. And you probably still need a Firebug (check FAQs in this forum section) to help yourself.
You can support Community by voting for Project on the JED
https://extensions.joomla.org/extension/virtuemart/#reviews
Join us at
https://twitter.com/virtuemart

jenkinhill

You just need to be more specific with your style selectors, work back through the classes within the same div to find a class unique to the template you want to restyle. eg the following works with defaul VM templates to set the price font size on the product details page only:

.spacer-buy-area .PricesalesPrice  {font-size:20px;}
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

chrisnz

Quote from: jenkinhill on August 17, 2013, 11:12:24 AM
You just need to be more specific with your style selectors, work back through the classes within the same div to find a class unique to the template you want to restyle. eg the following works with defaul VM templates to set the price font size on the product details page only:

.spacer-buy-area .PricesalesPrice  {font-size:20px;}

Fantastic - thanks!