Page 1 of 2 12 LastLast
Results 1 to 10 of 11
  1. #1
    Join Date
    Aug 2008
    Posts
    2
    Plugin Contributions
    0

    Default Adding Description to Featured Products Sidebox

    I have tried looking at the other thread, adding description to new and featured products, but I don't think it solves my problem. I would basically like to alter the featured products sidebox (found at includes/templates/templates_default/sideboxes/tpl_featured.php) in order to show a SHORTENED description underneath the Products Name and before the Price. I imagine this is possible since the featured_products page also allows for shortened descriptions (length of description edited at Configuration/Featured Listing from the Zencart admin home) but as I am no code whizz I have no idea how to do this! Any help would be deeply appreciated, many thanks, Sophia

  2. #2
    Join Date
    Sep 2004
    Location
    Western Massachusetts
    Posts
    2,945
    Plugin Contributions
    5

    Default Re: Adding Description to Featured Products Sidebox

    Edit includes/templates/template_default/sideboxes/tpl_featured.php - insert this code where you want the description to be (I'd suggest just before the price)
    Code:
    $content .= '<br />' . zen_trunc_string(zen_clean_html(stripslashes(zen_get_products_description($listing->fields['products_id'], $_SESSION['languages_id']))), PRODUCT_FEATURED_LIST_DESCRIPTION) . '<br />';
    and save the edited file in your override folder - includes/templates/YOUR_TEMPLATE/sideboxes/tpl_featured.php

    The code snippet above will use the length of the description you enter from Admin->Configuration->Featured Listing->Display Product Description
    Neville
    An assumption is what you arrive at when you get tired of thinking...

  3. #3
    Join Date
    Dec 2006
    Location
    UK
    Posts
    32
    Plugin Contributions
    0

    Default Re: Adding Description to Featured Products Sidebox

    The addition of this code looked promising but it didn't work for me.

    I've tried finding a way of displaying the description, price and add to cart button in the featured sidebox but amending tpl_featured.php seems to do nothing and I can't find any relevant admin switches.

    This question comes up a lot but I've never found a satisfactory answer.

  4. #4
    Join Date
    Feb 2007
    Posts
    17
    Plugin Contributions
    0

    Default Re: Adding Description to Featured Products Sidebox

    If the question is to display in home page the complete list of the featured products, as it appear in the specific page, I did this way:

    [FONT=Times New Roman]Copy the file:[/FONT]

    [FONT=Courier New]includes\templates\template_default\templates\tpl_featured_products_default.php[/FONT]


    [FONT=Times New Roman]in the following directory:[/FONT]

    [FONT=Courier New]includes\templates\your_template\templates\[/FONT]


    [FONT=Times New Roman]and rename it:[/FONT]

    [FONT=Courier New]tpl_modules_featured_products.php[/FONT]


    [FONT=Times New Roman]At this point the featured produts should be displayed in home in the “extended mode”. But some messages (i.e. TEXT_PRODUCTS_WEIGHT) are not converted in the correct text.[/FONT]

    [FONT=Times New Roman]To obtain this conversion, it is needed to call in the home page the file (my language is Italian – apply the modifications for your language):[/FONT]

    [FONT=Courier New]includes\languages\italian\featured_products.php[/FONT]


    [FONT=Times New Roman]To do this, I suggest: [/FONT]

    [FONT=Times New Roman]Copy the file:[/FONT]

    [FONT=Courier New]includes\languages\italian\featured_products.php[/FONT]


    [FONT=Times New Roman]and rename it, i.e., as follows:[/FONT]

    [FONT=Courier New]includes\languages\italian\featured_products_home.php[/FONT]


    [FONT=Times New Roman]therefore, open file (in a text editor):[/FONT]

    [FONT=Courier New]includes\languages\ita[/FONT][FONT=Courier New]lian.php[/FONT]


    [FONT=Times New Roman]insert the following lines (i.e. towards the end, after line 694):[/FONT]

    [FONT=Courier New]// include speciale per prodotti in vetrina in home page[/FONT]
    [FONT=Courier New]if (file_exists(DIR_WS_LANGUAGES . $_SESSION['language'] . [/FONT][FONT=Courier New]'/' . $template_dir . '/featured_products_home.php')) {[/FONT]
    [FONT=Courier New]$template_dir_select = $template_dir . '/';[/FONT]
    [FONT=Courier New]} else {[/FONT]
    [FONT=Courier New]$template_dir_select = '';[/FONT]
    [FONT=Courier New]}[/FONT]
    [FONT=Courier New]require_once(DIR_WS_LANGUAGES . $_SESSION['language'] . '/' . $template_dir_select . 'featured_products_home.php');[/FONT]


    [FONT=Times New Roman]save the file in your template:[/FONT]

    [FONT=Courier New]includes\languages\your_template\italian.php[/FONT]


    [FONT=Times New Roman]Since we have copied the file [/FONT][FONT=Courier New]featured_products.php[/FONT][FONT=Times New Roman]eand renamed in[/FONT][FONT=Courier New] featured_products_home.php [/FONT][FONT=Times New Roman]we will be able to do all modification on the messages, without any alteration of the original meggases of the Featured Products[/FONT]

    [FONT=Times New Roman](Excuse me my poor english)[/FONT]

  5. #5
    Join Date
    Feb 2007
    Posts
    17
    Plugin Contributions
    0

    Default Re: Adding Description to Featured Products Sidebox

    After posted my previous messages, I realized that your need was to display the product description in the SIDEBOX.
    What I have suggested is related to the centerbox.
    Sorry

  6. #6
    Join Date
    Dec 2006
    Location
    UK
    Posts
    32
    Plugin Contributions
    0

    Default Re: Adding Description to Featured Products Sidebox

    Thanks Nannid. Your explanation is very comprehensive and yes, it's the sidebox php file which requires the amendment. Thanks again.

  7. #7
    Join Date
    Apr 2004
    Location
    UK
    Posts
    5,821
    Plugin Contributions
    2

    Default Re: Adding Description to Featured Products Sidebox

    Back up first
    /includes/templates/nameofyourtemplate/sideboxes/tpl_featured.php
    ~~~~~~~~~~~~~~~~~~~~~~
    ..under
    Code:
    $content .= '<div>' . $featured_box_price . '</div>';
    ADD
    Code:
     $content .= '<br />' . zen_trunc_string(zen_clean_html(stripslashes(zen_get_products_description($random_featured_product->fields['products_id'], $_SESSION['languages_id']))), PRODUCT_FEATURED_LIST_DESCRIPTION) . '<br />';

  8. #8
    Join Date
    Feb 2008
    Posts
    174
    Plugin Contributions
    0

    Default Re: Adding Description to Featured Products Sidebox

    Hmmm ... can't find the line you refer to in my tpl_featured

    I have descriptions showing but they are truncated, I want full description on home page. Here is my file:

    PHP Code:
    <?php
    /**
     * Side Box Template
     *
     * @package templateSystem
     * @copyright Copyright 2003-2007 Zen Cart Development Team
     * @copyright Portions Copyright 2003 osCommerce
     * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
     * @version $Id: tpl_featured.php 6128 2007-04-08 04:53:32Z birdbrain $
     */
      
    $content "";
      
    $featured_box_counter 0;
      while (!
    $random_featured_product->EOF) {
        
    $featured_box_counter++;
        
    $featured_box_price zen_get_products_display_price($random_featured_product->fields['products_id']);
        
    $content .= '<div class="sideBoxContent centeredContent">';
        
    $content .=  '
        
        
                    <table style="width:100%;">
                        <tr>
                            <td>
        
        
    <table style="width:1px; margin:auto;" align="center">
        <tr>
            <td>
                
    <div class="img_box1">
        <div class="bg_inner1">
        <div class="bg_inner2">
        <div class="bg_inner3">
        <div class="bg_inner4">
        <div class="bg_inner5">
        <div class="bg_inner6">
        <div class="bg_inner7">
        <div class="bg_inner8">
        <div class="bg_inner9"><a href="' 
    zen_href_link(zen_get_info_page($random_featured_product->fields["products_id"]), 'cPath=' zen_get_generated_category_path_rev($random_featured_product->fields["master_categories_id"]) . '&products_id=' $random_featured_product->fields["products_id"]) . '">' zen_image(DIR_WS_IMAGES $random_featured_product->fields['products_image'], $random_featured_product->fields['products_name'], SMALL_IMAGE_WIDTHSMALL_IMAGE_HEIGHT); 
        
    $content .= '</a></div>
        </div>
        </div>
        </div>
        </div>
        </div>
        </div>
        </div>
        </div>
    </div>
            </td>
        </tr>
    </table>
        
                            <div class="clear"></div>

                            </td>
                            <td>
                                <div style="width:8px;"></div>
                            </td>
                            <td style="width:100%;">
        

        
        '
    ;
        
        
    $content .= '<div style="padding-top:5px; padding-left:0; " class="productSpecialPrice">' $whats_new_price '</div>
        
        
        
                            </td>
                        </tr>
                    </table>
                    
        '
    ;


        
         
    $content .= '<div style="padding-left:0; padding-top:0;  padding-bottom:0;"><b><a href="' zen_href_link(zen_get_info_page($random_featured_product->fields["products_id"]), 'cPath=' zen_get_generated_category_path_rev($random_featured_product->fields["master_categories_id"]) . '&products_id=' $random_featured_product->fields["products_id"]) . '">' $random_featured_product->fields['products_name'] . '</a></b></div>';
        
        
        
    $content .= '</div>';
        
    $random_featured_product->MoveNextRandom();
      }
    ?>
    Where do I insert the zen_trunc_string???

  9. #9
    Join Date
    Apr 2004
    Location
    UK
    Posts
    5,821
    Plugin Contributions
    2

    Default Re: Adding Description to Featured Products Sidebox

    That code is not the normal for featured sidebox...what
    template are you using?

  10. #10
    Join Date
    Feb 2008
    Posts
    174
    Plugin Contributions
    0

    Default Re: Adding Description to Featured Products Sidebox

    that's what I feared.
    I'm using a Monster Template

    And actually, I am not aiming to do sidebox, but center column featured products

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. v151 Adding description to featured products on products listing page
    By khejit in forum Templates, Stylesheets, Page Layout
    Replies: 0
    Last Post: 14 Oct 2014, 12:28 PM
  2. v139h Adding Featured Products under Product description
    By gifts4baby in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 20 Aug 2012, 09:43 PM
  3. adding description to new or featured products
    By winky3d in forum Templates, Stylesheets, Page Layout
    Replies: 29
    Last Post: 15 Apr 2011, 04:00 PM
  4. Can I increase the Number of Featured products in Featured Sidebox
    By OhISeekYou in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 9 Aug 2007, 08:28 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