Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / Adding text next to price and making it bold??

Adding text next to price and making it bold??

Locked

Views: 3,212

Results 1 to 6 of 6
This thread is locked. New replies are disabled.
19 Aug 2009, 10:26 PM
#1
nas000 avatar

nas000

New Zenner

Join Date:
Aug 2009
Posts:
3
Plugin Contributions:
0

Adding text next to price and making it bold??

Hi everyone, this is my first post but i have been using zencart for a while now and just getting the hang of it...:blush:

Basically i was wondering how i might add the text 'ONLY' before all of the prices. For example ONLY £3.99

Ive searched all over and i took a look at the tpl_product_info file with no luck...anyone with any ideas?

ALSO, how can i make the prices appear in **bold **in the products listing (when someone searches ALL products in a category)...just think the price needs to stand out a bit more.

I have Zencart 1.3.8 by the way...thanks in advance!

20 Aug 2009, 3:51 PM
#2
scottbrown_14 avatar

scottbrown_14

New Zenner

Join Date:
Mar 2009
Location:
Huddersfield, UK
Posts:
14
Plugin Contributions:
0

Re: Adding text next to price and making it bold??

Hi,

You were in the correct file. Go to line 62 and you'll see this:

<!--bof Product Price block -->
<h2 id="productPrices" class="productGeneral">
<?php
// base price
  if ($show_onetime_charges_description == 'true') {
    $one_time = '<span >' . TEXT_ONETIME_CHARGE_SYMBOL . TEXT_ONETIME_CHARGE_DESCRIPTION . '</span><br />';
  } else {
    $one_time = '';
  }
  echo $one_time . ((zen_has_product_attributes_values((int)$_GET['products_id']) and $flag_show_product_info_starting_at == 1) ? TEXT_BASE_PRICE : '') . zen_get_products_display_price((int)$_GET['products_id']);
?></h2>
<!--eof Product Price block -->

Using the override system, change it to this:

<!--bof Product Price block -->
<h2 id="productPrices" class="productGeneral">Only 
<?php
// base price
  if ($show_onetime_charges_description == 'true') {
    $one_time = '<span >' . TEXT_ONETIME_CHARGE_SYMBOL . TEXT_ONETIME_CHARGE_DESCRIPTION . '</span><br />';
  } else {
    $one_time = '';
  }
  echo $one_time . ((zen_has_product_attributes_values((int)$_GET['products_id']) and $flag_show_product_info_starting_at == 1) ? TEXT_BASE_PRICE : '') . zen_get_products_display_price((int)$_GET['products_id']);
?></h2>
<!--eof Product Price block -->

I've not tested this but I believe it will work. Let us know if it's ok.

I'm not sure exactly where to look for making the price bold in the category product list. It will involve adding a class to the cell then applying a rule in css (or wrapping the php price tag with <strong></strong> or <b></b>).

11 Oct 2009, 1:20 AM
#3
dbj_media avatar

dbj_media

New Zenner

Join Date:
Apr 2009
Posts:
17
Plugin Contributions:
0

Re: Adding text next to price and making it bold??

where is the tpl_product_info page found?? What folder?????

11 Oct 2009, 1:49 AM
#4
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Adding text next to price and making it bold??

The location described will not read as desired if the prices have the "Starting at" text (happens with attribute pricing). A more reliable location would be in this line:php echo $one_time . ((zen_has_product_attributes_values((int)$_GET['products_id']) and $flag_show_product_info_starting_at == 1) ? TEXT_BASE_PRICE : '') . zen_get_products_display_price((int)$_GET['products_id']); Add the "Only" before zen_get_products_display_price(```php
echo $one_time . ((zen_has_product_attributes_values((int)$_GET['products_id']) and $flag_show_product_info_starting_at == 1) ? TEXT_BASE_PRICE : '') . 'Only ' . zen_get_products_display_price((int)$_GET['products_id']);


/includes/templates/your_template/templates/tpl_product_info_display.php

Copy from the /template_default/ folder to your custom template folder and edit there.
11 Oct 2009, 1:56 AM
#5
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Adding text next to price and making it bold??

The price already has an id which you can style in your stylesheet:

#productPrices {}

This will affect all of the text within the price block.

11 Oct 2009, 2:06 AM
#6
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Adding text next to price and making it bold??

To allow the product listing price to be styled using .listingPrice {}

/includes/modules/your_template/product_listing.php, around line 107:```php
case 'PRODUCT_LIST_PRICE':
$lc_price = zen_get_products_display_price($listing->fields['products_id']) . '<br />';
$lc_align = 'right';
$lc_text = $lc_price;

    // more info in place of buy now
        $lc_price = '<span class="listingPrice">' . zen_get_products_display_price($listing->fields['products_id']) . '</span><br />';
```