Results 1 to 5 of 5
  1. #1
    Join Date
    Aug 2006
    Posts
    110
    Plugin Contributions
    0

    Default Why does this only work in the product listing - CSS puzzle

    Hi again.

    Sorry for posting something that someone else might have asked, but it's so hard getting the right question.

    Anyway, I want 'While Stocks Last!!!!!!!' in bold red.

    I've done it by applying an inline style to my listing:

    <p style="color: red; font-weight: bold">
    WHILE STOCKS LAST!!!!!
    </p>

    That works fine

    but........why doesn't the style work in the category listing?

    Here's where it works:

    http://www.wheredidyougetit.co.uk/sh...&products_id=9

    Here's where it doesn't:

    http://www.wheredidyougetit.co.uk/sh...=index&cPath=3

    As a side issue, I don't really want to type that inline style, but I don't know how
    to write the code and modify the stylesheet to achieve this. Ideally I just want to type something along the lines of <p style=boldred > and define 'boldred' in my css.

    Cheers everyone, a little donation once my eBay auction finishes tonight :-)

  2. #2
    Join Date
    Jan 2007
    Posts
    34
    Plugin Contributions
    0

    Default Re: Why does this only work in the product listing - CSS puzzle

    I'm pretty sure the product listing page doesn't read the html/css from product descriptions, so you wont be able to bold just part of the description.

  3. #3
    Join Date
    Nov 2005
    Location
    Colorado Springs, CO USA
    Posts
    7,033
    Plugin Contributions
    31

    Default Re: Why does this only work in the product listing - CSS puzzle

    To answer your question about styling the paragraph so it shows as red without using an inline style;

    Use this instead:
    <p class="alert">WHILE STOCKS LAST!!!!!</p>

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

    Default Re: Why does this only work in the product listing - CSS puzzle

    You can make HTML display in the product listing description.

    In /includes/modules/your_template/product_listing.php around line 95, find this section:
    PHP Code:
          case 'PRODUCT_LIST_NAME':
            
    $lc_align '';
            if (isset(
    $_GET['manufacturers_id'])) {
              
    $lc_text '<h3 class="itemTitle"><a href="' zen_href_link(zen_get_info_page($listing->fields['products_id']), 'products_id=' $listing->fields['products_id']) . '">' $listing->fields['products_name'] . '</a></h3><div class="listingDescription">' zen_trunc_string(zen_clean_html(stripslashes(zen_get_products_description($listing->fields['products_id'], $_SESSION['languages_id']))), PRODUCT_LIST_DESCRIPTION) . '</div>' ;
            } else {
              
    $lc_text '<h3 class="itemTitle"><a href="' zen_href_link(zen_get_info_page($listing->fields['products_id']), ($_GET['cPath'] > 'cPath=' $_GET['cPath'] . '&' '') . 'products_id=' $listing->fields['products_id']) . '">' $listing->fields['products_name'] . '</a></h3><div class="listingDescription">' zen_trunc_string(/*zen_clean_html gjh42 4/29/06*/(stripslashes(zen_get_products_description($listing->fields['products_id'], $_SESSION['languages_id']))), PRODUCT_LIST_DESCRIPTION) . '</div>';
            }
            break; 
    and comment out the zen_clean_html like this /*zen_clean_html*/ to get this:
    PHP Code:
          case 'PRODUCT_LIST_NAME':
            
    $lc_align '';
            if (isset(
    $_GET['manufacturers_id'])) {
              
    $lc_text '<h3 class="itemTitle"><a href="' zen_href_link(zen_get_info_page($listing->fields['products_id']), 'products_id=' $listing->fields['products_id']) . '">' $listing->fields['products_name'] . '</a></h3><div class="listingDescription">' zen_trunc_string(/*zen_clean_html*/ (stripslashes(zen_get_products_description($listing->fields['products_id'], $_SESSION['languages_id']))), PRODUCT_LIST_DESCRIPTION) . '</div>' ;
            } else {
              
    $lc_text '<h3 class="itemTitle"><a href="' zen_href_link(zen_get_info_page($listing->fields['products_id']), ($_GET['cPath'] > 'cPath=' $_GET['cPath'] . '&' '') . 'products_id=' $listing->fields['products_id']) . '">' $listing->fields['products_name'] . '</a></h3><div class="listingDescription">' zen_trunc_string(/*zen_clean_html gjh42 4/29/06*/(stripslashes(zen_get_products_description($listing->fields['products_id'], $_SESSION['languages_id']))), PRODUCT_LIST_DESCRIPTION) . '</div>';
            }
            break; 
    A caution: if you have extensive html in your description and a limited description length, some code may be truncated giving errors.

  5. #5
    Join Date
    Aug 2006
    Posts
    110
    Plugin Contributions
    0

    Default Re: Why does this only work in the product listing - CSS puzzle

    Perfect, thanks.

 

 

Similar Threads

  1. v150 why does this code not work?
    By nazca in forum General Questions
    Replies: 6
    Last Post: 9 Oct 2013, 02:19 PM
  2. Why Does this SQL not work?
    By plymgary1 in forum General Questions
    Replies: 5
    Last Post: 7 Jun 2011, 11:24 AM
  3. Why does my css menu look like this?
    By Spdster in forum Templates, Stylesheets, Page Layout
    Replies: 0
    Last Post: 9 Dec 2008, 07:18 PM
  4. Why does this Product Listing appear different than others
    By guerrilladigital in forum Setting Up Categories, Products, Attributes
    Replies: 0
    Last Post: 9 Oct 2008, 05:27 PM
  5. Why does my store sum up all the attribute prices under the product listing page ????
    By watzursn in forum Setting Up Categories, Products, Attributes
    Replies: 5
    Last Post: 8 Sep 2008, 12:20 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