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!
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:
Code:
<!--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:
Code:
<!--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>).
Re: Adding text next to price and making it bold??
where is the tpl_product_info page found?? What folder?????
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 Code:
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 Code:
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.
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.
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 Code:
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
PHP Code:
$lc_price = '<span class="listingPrice">' . zen_get_products_display_price($listing->fields['products_id']) . '</span><br />';