Results 1 to 10 of 10
  1. #1
    Join Date
    Nov 2007
    Posts
    270
    Plugin Contributions
    0

    Default Add field (short desc.) to All Listing Products

    I have Short Desc. mod and I would like to add this field to "Listing All Products" "New Products". I tried to find the appropriate page(s) via Dev. Tool Kit, made changes in few pages (god, I have to keep track of these...), but still I did not find the right place/page since it does not appear on these pages. Could someone please point me to these pages??
    Tx

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

    Default Re: Add field (short desc.) to All Listing Products

    /includes/templates/your_template/templates/tpl_modules_products_all_listing.php, /includes/templates/your_template/templates/tpl_modules_products_new_listing.php.

    The description is added below the rest of the elements of this listing style, around line 108:
    if (PRODUCT_ALL_LIST_DESCRIPTION != '0') {
    etc.

    and line 192:
    <?php if (PRODUCT_ALL_LIST_DESCRIPTION != 0) { ?>
    etc.

  3. #3
    Join Date
    Nov 2007
    Posts
    270
    Plugin Contributions
    0

    Default Re: Add field (short desc.) to All Listing Products

    Quote Originally Posted by gjh42 View Post
    /includes/templates/your_template/templates/tpl_modules_products_all_listing.php, /includes/templates/your_template/templates/tpl_modules_products_new_listing.php.

    The description is added below the rest of the elements of this listing style, around line 108:
    if (PRODUCT_ALL_LIST_DESCRIPTION != '0') {
    etc.

    and line 192:
    <?php if (PRODUCT_ALL_LIST_DESCRIPTION != 0) { ?>
    etc.
    Around those line I have:
    if (PRODUCT_ALL_LIST_DESCRIPTION > '0') {

    but have added the following to around lines 48:

    if (PRODUCT_INFO_SHORT_DESC != '0') {
    $dislay_products_short_desc = TABLE_HEADING_SHORT_DESC . $products_all->fields['products_short_desc'] . str_repeat('<br clear="all" />', substr(PRODUCT_ALL_LIST_SHORT_DESC, 3, 1));
    } else {
    $dislay_products_short_desc = '';
    }

    but is does not do anything....

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

    Default Re: Add field (short desc.) to All Listing Products

    That file works in two parts. The first part creates the content (which it looks like your code is doing), and the second part (starting around line 118) arranges the output into two columns, with the description below both columns.

    You will have to decide where you want the short description to go and place an "echo" statement there, like the other elements have.

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

    Default Re: Add field (short desc.) to All Listing Products

    You need to keep the short description echo out of the loop, since it doesn't have a configuration key for that listing, so put it like this if you want it at the bottom of the left or right column:
    PHP Code:
                      if ($disp_sort_order->fields['configuration_key'] == 'PRODUCT_ALL_LIST_DATE_ADDED') {
                        echo 
    $display_products_date_added;
                      }
                      
    $disp_sort_order->MoveNext();
                    } 
    //end of while loop
                    
    echo $display_products_short_desc
    Alternatively, you could put it in with another element if you want it grouped that way:
    PHP Code:
                      if ($disp_sort_order->fields['configuration_key'] == 'PRODUCT_ALL_LIST_DATE_ADDED') {
                        echo 
    $display_products_short_desc;
                        echo 
    $display_products_date_added;
                      }
                      
    $disp_sort_order->MoveNext();
                    } 
    //end of while loop 
    Last edited by gjh42; 17 Dec 2007 at 01:02 AM.

  6. #6
    Join Date
    Nov 2007
    Posts
    270
    Plugin Contributions
    0

    Default Re: Add field (short desc.) to All Listing Products

    Quote Originally Posted by gjh42 View Post
    You need to keep the short description echo out of the loop, since it doesn't have a configuration key for that listing, so put it like this if you want it at the bottom of the left or right column:
    PHP Code:
                      if ($disp_sort_order->fields['configuration_key'] == 'PRODUCT_ALL_LIST_DATE_ADDED') {
                        echo 
    $display_products_date_added;
                      }
                      
    $disp_sort_order->MoveNext();
                    } 
    //end of while loop
                    
    echo $display_products_short_desc
    Alternatively, you could put it in with another element if you want it grouped that way:
    PHP Code:
                      if ($disp_sort_order->fields['configuration_key'] == 'PRODUCT_ALL_LIST_DATE_ADDED') {
                        echo 
    $display_products_short_desc;
                        echo 
    $display_products_date_added;
                      }
                      
    $disp_sort_order->MoveNext();
                    } 
    //end of while loop 

    Thanks, I will try this..
    As I was looking into files of Short Desc., I noticed that in admin/include/modules/products/collect_info.php (part of it bellow) it does not select "pd.products_short_desc" but I don't know if it should be pd.xx or just p.xx

    if (isset($_GET['pID']) && empty($_POST)) {
    $product = $db->Execute("select pd.products_name, pd.products_description, pd.products_url,
    p.products_id, p.products_quantity, p.products_model,

    Also this file has
    $products_short_description = $_POST['products_short_description'];
    I am guessing it should be
    $products_short_desc = $_POST['products_short_desc'];
    Am I correct?

  7. #7
    Join Date
    Nov 2007
    Posts
    270
    Plugin Contributions
    0

    Default Re: Add field (short desc.) to All Listing Products

    You need to keep the short description echo out of the loop, since it doesn't have a configuration key for that listing, so put it like this if you want it at the bottom of the left or right column:


    Well I tried both, no result..

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

    Default Re: Add field (short desc.) to All Listing Products

    Do you have the short description working for the product listing? If not, don't try to make it work here until you have it functioning as designed.

    The collect_info.php works in admin and has no connection to the store output, except that it has to function in order for there to be a short description.
    As far as I know, the mod works correctly as written, and you should not go changing that.


    You wrote that you added

    ...
    $dislay_products_short_desc = TABLE_HEADING_SHORT_DESC ...

    Is this an exact copy of what is in your file? It is missing the "p" from display, so will not match the echo code as I wrote it:

    echo $display_products_short_desc;
    Last edited by gjh42; 17 Dec 2007 at 02:20 AM.

  9. #9
    Join Date
    Nov 2007
    Posts
    270
    Plugin Contributions
    0

    Default Re: Add field (short desc.) to All Listing Products

    Quote Originally Posted by gjh42 View Post
    Do you have the short description working for the product listing? If not, don't try to make it work here until you have it functioning as designed.

    The collect_info.php works in admin and has no connection to the store output, except that it has to function in order for there to be a short description.
    As far as I know, the mod works correctly as written, and you should not go changing that.


    You wrote that you added

    ...
    $dislay_products_short_desc = TABLE_HEADING_SHORT_DESC ...

    Is this an exact copy of what is in your file? It is missing the "p" from display, so will not match the echo code as I wrote it:

    echo $display_products_short_desc;
    Thank you for your help; I have it working in the product listing and category listing. I guess that will have to do.
    And yes, I had a typo you mentioned, thanks. However, even after I corrected that, I still did not get it to display in new or all listings.

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

    Default Re: Add field (short desc.) to All Listing Products

    I haven't looked at the short description mod, so this is just speculation, but if you have the short desc stored in a new db field, the all products page would need to retrieve it when it gets the rest of the product information.
    If it doesn't do that, there is no content for $display_products_short_desc to hold or output.

 

 

Similar Threads

  1. Replies: 4
    Last Post: 20 Apr 2015, 09:09 AM
  2. Add A-Z Filter dropdown to ALL products listing
    By sydmich in forum General Questions
    Replies: 1
    Last Post: 14 Dec 2008, 11:07 AM
  3. Replies: 0
    Last Post: 24 Jun 2008, 06:54 PM
  4. Product Short description in all products listing
    By patski in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 2 Aug 2006, 09:10 PM

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