Page 1 of 2 12 LastLast
Results 1 to 10 of 15
  1. #1
    Join Date
    Aug 2004
    Location
    New York City
    Posts
    7,174
    Plugin Contributions
    0

    Default Product description question

    I'm trying for a variation on my earlier subcategory description question. I know Zen Cart will display the first 150 characters of the product description. Is there any way to start the data selection at a different point in the data? Is this handled in modules/product_listing.php?

    The subcategory solution may work for another site I'm working on which is more static, but not for one that will be more active and which someone else might be updating at some point. I don't want to wander too far from Zen Cart's built in functions and make the site too difficult to maintain.

  2. #2
    Join Date
    Aug 2004
    Location
    New York City
    Posts
    7,174
    Plugin Contributions
    0

    Default Re: Product description question

    I've pretty much answered my own question, but it requires tinkering with core code.

  3. #3
    Join Date
    Aug 2004
    Location
    New York City
    Posts
    7,174
    Plugin Contributions
    0

    Default Re: Product description question



    I DID IT!!! And I didn't have to touch the core!

    Eventually, I'll post a link to the site, but it's my nephew's site and he wants to send out emails to announce the site first.

    Anyway, I had to tinker with modules/CUSTOM_TEMPLATE/product_listing.php. I added the part in red to the section indicated and changed the bits in blue.

    Code:
    switch ($column_list[$col]) {
            case 'PRODUCT_LIST_MODEL':
            $lc_align = '';
            $lc_text = $listing->fields['products_model'];
            break;
            case 'PRODUCT_LIST_NAME':
            $lc_align = '';
            // get the product description (document contents) using the existing Zen function
            $listing->fields['products_description'] = zen_get_products_description($listing->fields['products_id'], $_SESSION['languages_id']);
            list($byline, $story) = explode("</p>", $listing->fields['products_description']);
            // end product description
           if (isset($_GET['manufacturers_id'])) {
            //  $lc_text = '<h3 class="itemTitle"><a href="' . zen_href_link(zen_get_info_page($listing->fields['products_id']), 'cPath=' . (($_GET['manufacturers_id'] > 0 and $_GET['filter_id']) > 0 ?  zen_get_generated_category_path_rev($_GET['filter_id']) : ($_GET['cPath'] > 0 ? zen_get_generated_category_path_rev($_GET['cPath']) : zen_get_generated_category_path_rev($listing->fields['master_categories_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>' ;
              $lc_text = '<h3 class="itemTitle"><a href="' . zen_href_link(zen_get_info_page($listing->fields['products_id']), 'cPath=' . (($_GET['manufacturers_id'] > 0 and $_GET['filter_id']) > 0 ?  zen_get_generated_category_path_rev($_GET['filter_id']) : ($_GET['cPath'] > 0 ? zen_get_generated_category_path_rev($_GET['cPath']) : zen_get_generated_category_path_rev($listing->fields['master_categories_id']))) . '&products_id=' . $listing->fields['products_id']) . '">' . $listing->fields['products_name'] . '</a></h3><div class="listingDescription">' . zen_trunc_string($story) . '</div>' ;
            } else {
            //  $lc_text = '<h3 class="itemTitle"><a href="' . zen_href_link(zen_get_info_page($listing->fields['products_id']), 'cPath=' . (($_GET['manufacturers_id'] > 0 and $_GET['filter_id']) > 0 ?  zen_get_generated_category_path_rev($_GET['filter_id']) : ($_GET['cPath'] > 0 ? zen_get_generated_category_path_rev($_GET['cPath']) : zen_get_generated_category_path_rev($listing->fields['master_categories_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>';
              $lc_text = '<h3 class="itemTitle"><a href="' . zen_href_link(zen_get_info_page($listing->fields['products_id']), 'cPath=' . (($_GET['manufacturers_id'] > 0 and $_GET['filter_id']) > 0 ?  zen_get_generated_category_path_rev($_GET['filter_id']) : ($_GET['cPath'] > 0 ? zen_get_generated_category_path_rev($_GET['cPath']) : zen_get_generated_category_path_rev($listing->fields['master_categories_id']))) . '&products_id=' . $listing->fields['products_id']) . '">' . $listing->fields['products_name'] . '</a></h3><div class="listingDescription">' . zen_trunc_string($story) . '</div>';
            }
    I'm really proud of me.

  4. #4
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Product description question

    Almost under an hour from start to finish ... getting scary now ...

    Keep it up ...
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  5. #5
    Join Date
    Aug 2004
    Location
    New York City
    Posts
    7,174
    Plugin Contributions
    0

    Default Re: Product description question

    I'm amazed that I actually got it to work. I had to go to the php website to get the "explode" function which did exactly what I needed. My nephew seems to like the look of what I was doing using subcategories, but this will be much easier to maintain since it doesn't require the extra steps involved in creating the subcategories.

  6. #6
    Join Date
    Feb 2005
    Location
    Lansing, Michigan USA
    Posts
    20,021
    Plugin Contributions
    3

    Default Re: Product description question

    I know who I'm PM'ing with all my PHP questions now.

  7. #7
    Join Date
    Aug 2004
    Location
    New York City
    Posts
    7,174
    Plugin Contributions
    0

    Default Re: Product description question

    You better mean Ajeh. I probably have an advantage since I'm a programmer, but php is new territory for me. I look at the php files and do a lot of and

  8. #8
    Join Date
    Apr 2008
    Posts
    283
    Plugin Contributions
    0

    Default Re: Product description question

    Yall are funny but it is great to have a forum full of amazing people who can answer my questions lol. So why don't I throw a few at you.

    First of all I love this website...

    http://www.frontiersoups.com/p-CA-White-Bean-Chili.html

    and I am interested in getting my product info similiar to this.

    I will come back to that though. My first question is how can I have for example a sentence explaining something about my product

    "lkajdlfkjsd;lf this product rocks lkjadlkf"

    With one type of font...a more catchy and little bigger font. Then under that have a smaller and more professional font with the ingredients and stuff like that. My question is how can i have multiple font sizes and descriptions. I have a product_info.css which i can edit the #productDescription but that is about it.

    I am also very interested in knowing how to break up the descriptions for example like this website

    http://www.frontiersoups.com/p-CA-White-Bean-Chili.html

    They have the image with some prices and different font and color. Then they have another image set off to the left I would love to know how to do that as well as below that have other recommended products and more description at the bottom. I pretty much love the layout of this site that is why I am referencing it. Is this possible with zen cart? The site I am working on right now is located here

    http://www.wpc-consulting.com/~stxmill/

    If anyone has any ideas on how to do this I would LOVE TO KNOW!! Also if you have any suggestions on the site please fill free to let me know. It goes up on Sept. the 8th. I know the colors are HIDEOUS!! They are being picked out by the owner and will be changed along with text and buttons to match the background colors as well. Still lots of work to be done before the launch date any help is MUCH APPRECIATE!! Thanks and KEEP UP THE GREAT WORK GUYS!!

  9. #9
    Join Date
    Aug 2004
    Location
    New York City
    Posts
    7,174
    Plugin Contributions
    0

    Default Re: Product description question

    I need to apply the same thing to "new products" and "all products". What files need to be changed?

  10. #10
    Join Date
    Apr 2008
    Posts
    283
    Plugin Contributions
    0

    Default Re: Product description question

    I'm sorry I don't understand the question. I am interested in having multiple description areas. I have discovered that I can have descriptions and just have spaces in between and I can still change the font size and text which is nice. However I was also wanting to do something similar to the site i mentioned above to where I can have brief description then maybe an image or something underneath it then some more descriptions. This is all on the product information page. Like product_info_display.php or something?

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. product description question
    By ilovedoingwebsites in forum Templates, Stylesheets, Page Layout
    Replies: 8
    Last Post: 31 May 2011, 11:23 PM
  2. product description question
    By nevada in forum Setting Up Categories, Products, Attributes
    Replies: 4
    Last Post: 22 Feb 2010, 07:59 AM
  3. Product Description Question
    By hottytoddysummer in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 26 Mar 2008, 08:29 PM
  4. Product Description question
    By JohnsonY in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 22 Nov 2006, 07:52 AM

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