Results 1 to 6 of 6
  1. #1
    Join Date
    Aug 2009
    Posts
    3
    Plugin Contributions
    0

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

    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!

  2. #2
    Join Date
    Mar 2009
    Location
    Huddersfield, UK
    Posts
    14
    Plugin Contributions
    0

    Default 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&nbsp;
    <?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>).

  3. #3
    Join Date
    Apr 2009
    Posts
    17
    Plugin Contributions
    0

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

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

  4. #4
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

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

  5. #5
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

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

  6. #6
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default 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 />'

 

 

Similar Threads

  1. Making just one word RED and BOLD
    By robbin21973 in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 9 Mar 2012, 07:09 PM
  2. Index Page New Products Title and Price - Bold?
    By kal in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 15 Jun 2009, 02:58 PM
  3. Paypal and bold text
    By pRS317 in forum General Questions
    Replies: 1
    Last Post: 21 Jun 2008, 12:36 AM
  4. making categories bold
    By ner0tik in forum Setting Up Categories, Products, Attributes
    Replies: 3
    Last Post: 10 Aug 2006, 10:23 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR