Results 1 to 7 of 7
  1. #1
    Join Date
    Dec 2012
    Posts
    607
    Plugin Contributions
    0

    Default How to display the last category name

    How do you display / extract the last (final) subcategory name in the following tree (path) by itself?
    Code:
    index.php?main_page=index&cPath=9_18_20
    Using Zen Cart 1.5.1

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

    Default Re: How to display the last category name

    A little more information about what you want to do and why. Do you want the last subcategory category name to appear in the URL?

  3. #3
    Join Date
    Dec 2012
    Posts
    607
    Plugin Contributions
    0

    Default Re: How to display the last category name

    If my breadcrumbs reads Home > Men's Shirts > T-shirts > V-Neck

    I need to display V-Neck dynamically in my subcategory description, on the product listing page.

    I hope i am making sense . Thank you of the reply.
    Using Zen Cart 1.5.1

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

    Default Re: How to display the last category name

    If I understand, it should do that already if you have the settings right and your template allows it. Please provide a link to the site.

  5. #5
    Join Date
    Dec 2012
    Posts
    607
    Plugin Contributions
    0

    Default Re: How to display the last category name

    Site is not live yet.

    This would be in addition to the existing subcategory name encapsulated in <h1>. I need to duplicated the name of subcategory encapsulated in <he> in other ares of the page.

    How can the name of subcategory being displayed on the product listing page, be replicated on that same page?
    Using Zen Cart 1.5.1

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

    Default Re: How to display the last category name

    PHP Code:
    <?php echo $breadcrumb->last(); ?>
    This is what puts the content into the <h1>, and it will do the same elsewhere on the page.

    You will need to edit /includes/templates/your_template/templates/tpl_index_product_list.php (copy from /template_default/ if you don't already have a custom copy).
    Last edited by gjh42; 30 Oct 2013 at 02:19 AM.

  7. #7
    Join Date
    Dec 2012
    Posts
    607
    Plugin Contributions
    0

    Default Re: How to display the last category name

    Quote Originally Posted by gjh42 View Post
    PHP Code:
    <?php echo $breadcrumb->last(); ?>
    This is what puts the content into the <h1>, and it will do the same elsewhere on the page.

    You will need to edit /includes/templates/your_template/templates/tpl_index_product_list.php (copy from /template_default/ if you don't already have a custom copy).
    That did it.
    Thanks for the hint I was placing the
    PHP Code:
    <?php echo $breadcrumb->last(); ?>
    in the tpl_index_categories.php instead of tpl_index_product_list.php.

    Thank you.
    Using Zen Cart 1.5.1

 

 

Similar Threads

  1. v151 How to make clicking a category display all its items under the category name??
    By tlyczko in forum Templates, Stylesheets, Page Layout
    Replies: 44
    Last Post: 27 Mar 2014, 06:17 PM
  2. How do I change the URL sub-page name to the Category name?
    By gwtnow21 in forum Templates, Stylesheets, Page Layout
    Replies: 8
    Last Post: 28 Jan 2011, 05:20 PM
  3. How to display Category name or Product name as a tagline?
    By ttmb33 in forum General Questions
    Replies: 0
    Last Post: 19 Jan 2010, 05:47 PM
  4. switch the display of order of first name and last name on each address
    By weber in forum Templates, Stylesheets, Page Layout
    Replies: 0
    Last Post: 21 Nov 2008, 07:34 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