Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 27
  1. #11
    Join Date
    Nov 2008
    Location
    Jervis Bay, NSW Australi
    Posts
    16
    Plugin Contributions
    0

    Default Re: Add Category Name to Product Listing above description

    In Answer to my last question:

    About the WIKI Docs

    Control Structures
    Function Calls
    Function Definitions
    Comments

    http://www.zen-cart.com/wiki/index.p...pers_Standards

    only its empty, I guess its a work in progress.
    nup, I got nothen.

  2. #12
    Join Date
    Nov 2008
    Location
    Jervis Bay, NSW Australi
    Posts
    16
    Plugin Contributions
    0

    Default Re: Add Category Name to Product Listing above description

    Well I was going to be a good samaratin and enter the details of this function to get the Wiki rolling but it wont let me register to edit its pages.

    Call the current categories id from the products id:
    <?php echo zen_get_products_category_id($product['id']);?>
    Needs to be on a page or in a array that knows the products_id.
    Last edited by maxidvd; 29 Nov 2008 at 12:38 AM.
    nup, I got nothen.

  3. #13
    Join Date
    Nov 2008
    Location
    Jervis Bay, NSW Australi
    Posts
    16
    Plugin Contributions
    0

    Idea or Suggestion Re: Add Category Name to Product Listing above description

    Call the current categories id from the products id:

    <?php
    echo zen_get_products_category_id($product['id']);
    ?>


    Needs to be on a page or in a array that knows the products_id.
    nup, I got nothen.

  4. #14
    Join Date
    Nov 2008
    Posts
    9
    Plugin Contributions
    0

    Default Re: Add Category Name to Product Listing above description

    I would like to show only the description and not the product name in the listing. I found a thread that talks about this but does not have any instructions on how to do it.
    https://www.zen-cart.com/forum/showthread.php?p=285189

    I am not all that great in PHP, I would appreciate any help.

  5. #15
    Join Date
    Nov 2008
    Location
    Jervis Bay, NSW Australi
    Posts
    16
    Plugin Contributions
    0

    Default Re: Add Category Name to Product Listing above description

    Hi Eljay

    In folder: zencart\includes\modules

    Create a new folder in there and name it exactly the same as your current template folder.

    If your using the CLASSIC template it would be this:
    zencart\includes\modules\CLASSIC without the capitals of course.

    Now go back to the zencart\includes\modules folder and find the file: product_listing.php

    And copy that file to you new folder:

    zencart\includes\modules\CLASSIC\product_listing.php

    Now that its copied into the new "Template Overide Folder" you need to edit the code with a text editing program like windows notepad.. or Winsyntax

    and search for ir browse lines 95 to 102 you will find this code snippet

    case 'PRODUCT_LIST_NAME':
    blah blah blah blah
    blah blah blah blah
    blah blah blah blah
    }
    break;

    use the code below and copy over it, this will remove then product name but leave the description intack.

    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']), '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>' ;
            } 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>';
            }
            break;
    */
    
            case 'PRODUCT_LIST_NAME':
            $lc_align = '';
            if (isset($_GET['manufacturers_id'])) {
              $lc_text = '<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 = '<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>';
            }
            break;
    Sounds like a lot of work, but its better to do it right using the template override system then to just go in and hack a system
    file that will make your site harder to update in the future.
    Cheers Lee
    nup, I got nothen.

  6. #16
    Join Date
    Nov 2008
    Posts
    9
    Plugin Contributions
    0

    Default Re: Add Category Name to Product Listing above description

    Quote Originally Posted by maxidvd View Post
    Hi Eljay

    In folder: zencart\includes\modules

    Create a new folder in there and name it exactly the same as your current template folder.

    If your using the CLASSIC template it would be this:
    zencart\includes\modules\CLASSIC without the capitals of course.
    .....................
    Lee, thanks for your help. I will give it a try and see how it comes out and let you know

  7. #17
    Join Date
    May 2011
    Posts
    6
    Plugin Contributions
    0

    Default Re: Add Category Name to Product Listing above description

    Quote Originally Posted by Ajeh View Post
    For the shopping_cart see if using for the products_id if:
    $product['id']

    works better for you to obtain the master_categories_id of the product ...
    Hi Guys,

    I know this is an extremely old post but I have been stuck on this all afternoon - hopefully someone can shed some more light on this issue. Not sure if you are still around Linda...

    I am looking to display the category name of each item on the shopping cart page. I have followed suggestions found here and I know this is a peculiar issue. I have been able to display master_categories_id and one would assume that displaying a name instead of the id is possible on the shopping cart page.
    I just cannot figure this one out.

    Linda you have been a wonderful help in this post. Thank you very much if you do happen to fly by.

    Any help or suggestions would be greatly appreciated.

    P.s. I am currently running the latest version of Zen Cart.

    Regards,
    Evan

  8. #18
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    64,649
    Plugin Contributions
    6

    Default Re: Add Category Name to Product Listing above description

    If you have the master_categories_id, you can use the function zen_get_categories_name to display the name ...
    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: v1.5.1]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...

  9. #19
    Join Date
    May 2011
    Posts
    6
    Plugin Contributions
    0

    Default Re: Add Category Name to Product Listing above description

    Quote Originally Posted by Ajeh View Post
    If you have the master_categories_id, you can use the function zen_get_categories_name to display the name ...
    Thanks for your swift reply.
    My beginners knowledge of php is certainly not helping me out.

    Could you please tell me if I am even on the right track with something like - currently not working

    Code:
    echo zen_get_categories_name($product['id'], 'master_categories_id');
    This is what I am using to display the master_catergoried_id and it is working perfectly:
    Code:
    echo zen_products_lookup($product['id'], 'master_categories_id');

    Currently working in file tpl_shopping_cart_default.php

    THanks :)

  10. #20
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    64,649
    Plugin Contributions
    6

    Default Re: Add Category Name to Product Listing above description

    You cut out the function in the second function ... try this:
    Code:
    echo zen_get_categories_name(zen_products_lookup($product['id'], 'master_categories_id'));
    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: v1.5.1]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...

 

 
Page 2 of 3 FirstFirst 123 LastLast

Similar Threads

  1. description under sub-category listing
    By stefknits in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 3 Mar 2008, 07:43 PM
  2. description under sub-category listing
    By stefknits in forum Templates, Stylesheets, Page Layout
    Replies: 0
    Last Post: 28 Feb 2008, 09:26 PM
  3. adding description to category listing
    By jonathan_pohl in forum Templates, Stylesheets, Page Layout
    Replies: 11
    Last Post: 12 Feb 2008, 12:48 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
  •