Zen Cart Logo
If this is your first visit, check our documentation. To post, register or login.
Forums / Customizing the Look of Your Shop / Templates, Stylesheets, Page Layout / Do not know where to add css rule to style item price

Do not know where to add css rule to style item price

Started by sports_guy on 4 Dec 2012, 3:16 PM · Views: 398

Results 1 to 3 of 3
4 Dec 2012, 3:16 PM
#1
sports_guy avatar

sports_guy

Totally Zenned

Join Date:
Apr 2007
Location:
Dayton, Ohio
Posts:
682
Plugin Contributions:
0

Post #1 by sports_guy

I am having a problem trying to style the products price. I do have columnar display enabled.

Please see an example here: http://www.lasilhouettelingerie.com/store/choker-c-193_196/ (this is where I want to style the products price).

If you look at the source code, there is no styling added to the product price and that's the reason this price font is plain black. I am looking for the file to add this styling, but do not see the price definitions in php. I have been in both:

\includes\templates\MyTemplate\templates\tpl_modules_product_listing.php
and
\includes\templates\MyTemplate\common\top_columnar_display.php

but still do not see where to add this css definition.

I know how to style via CSS if, I can get the style added to the correct php area. Any suggestions as to where I can find the code, to add a style for the price?

Building a better web, one site at a time: Dayton Web Design

4 Dec 2012, 3:25 PM
#2
stevesh avatar

stevesh

Black Belt

Join Date:
Feb 2005
Location:
Lansing, Michigan USA
Posts:
19,793
Plugin Contributions:
2

Post #2 by stevesh

Possibly in includes/modules/product_listing.php, around line 104.

4 Dec 2012, 4:42 PM
#3
sports_guy avatar

sports_guy

Totally Zenned

Join Date:
Apr 2007
Location:
Dayton, Ohio
Posts:
682
Plugin Contributions:
0

Post #3 by sports_guy

Thank you stevesh, I would have never found that file!

For anyone else with this same issue, look for this file:
includes/modules/product_listing.php

Find this code (line #149 - 152)

case 'PRODUCT_LIST_PRICE':
        $lc_price = zen_get_products_display_price($listing->fields['products_id']) . '<br />';
        $lc_align = 'right';
        $lc_text =  $lc_price;

and change to this:

case 'PRODUCT_LIST_PRICE':
        $lc_price = zen_get_products_display_price($listing->fields['products_id']);
        $lc_align = 'right';
        $lc_text =  '<div class="pprice">'.$lc_price. '</div>';

(I also removed the extra break here: . '<br />' but that is up to you)

Don't forget to save this file in: includes/modules/YOURTEMPLATE/product_listing.php.

Last add this .pprice class in your stylesheet.css with the definitions to modify the look.

Building a better web, one site at a time: Dayton Web Design