Forums / Templates, Stylesheets, Page Layout / Category name in product info page

Category name in product info page

Locked

Views: 1,724

Results 1 to 7 of 7
This thread is locked. New replies are disabled.
8 May 2007, 4:02 PM
#1
battra avatar

battra

New Zenner

Join Date:
May 2007
Posts:
24
Plugin Contributions:
0

Category name in product info page

How can I get the category name inside product info page (tpl_product_info_display.php)? I don't want to show the category icon, only get the name. Variable $breadcrumb->last() gives me the product name instead.

My showcase/gallery using Zen Cart - Summerdew

8 May 2007, 4:04 PM
#2
haredo avatar

haredo

Totally Zenned

Join Date:
Apr 2006
Location:
Texas
Posts:
6,187
Plugin Contributions:
0

Re: Category name in product info page

Please submit a url please.

Need a hand with Zen Cart? Hire the team at myZenCartZone.com for upgrades, repairs, and custom plugins.

Zen Cart Certified hosting at myZenCartHost.com.

9 May 2007, 2:33 AM
#3
battra avatar

battra

New Zenner

Join Date:
May 2007
Posts:
24
Plugin Contributions:
0

Re: Category name in product info page

Is URL really necessary for this? :dontgetit It's still in my local PC so I can't show you anything.

I'm not sure if there is API documentation for ZC but I'm wondering if there is a variable/function like $something->get_current_cat(), or something like that.

My showcase/gallery using Zen Cart - Summerdew

9 May 2007, 2:59 AM
#4
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Category name in product info page

The tpl_product_info_display.php calls the tpl_modules_category_icon_display.php which lists the image and name built from the module category_icon_display.php ...

You care mainly about the bottom line on what is shown ... this is in the:
/includes/templates/template_default/tpl_modules_category_icon_display.php

which you want to copy to your templates and overrides directory:
/includes/templates/your_template_dir/tpl_modules_category_icon_display.php

then change what is shown in:

<div align="<?php echo $align; ?>" id="categoryIcon" class="categoryIcon"><?php echo '<a href="' . zen_href_link(FILENAME_DEFAULT, $cPath_new, 'NONSSL') . '">' . $category_icon_display_image . $category_icon_display_name .  '</a>'; ?></div>

NOTE: the $category_icon_display_image is built with a '<br />' on it ...

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!

9 May 2007, 6:22 AM
#5
battra avatar

battra

New Zenner

Join Date:
May 2007
Posts:
24
Plugin Contributions:
0

Re: Category name in product info page

Ajeh, thanks for your reply. Perhaps I need to mention that I want to use the category name in other place of product info page, outside of categoryIcon block.

Below categoryIcon block there is a navigation block which shows 'previous', 'next', and 'listing' buttons. I want to change the 'listing' button to a text link that reads "Back to [category name] listing". So when I'm viewing a product in DVD category, the link should read "Back to DVD listing", and so on. That's why I need to get the category name. Right now I can only use generic text like 'Back to product list'.

I have looked at the tpl_modules_category_icon_display.php and try to use $category_icon_display_name variable but strangely it returns empty. Maybe I'll take a look at it again tonight. Otherwise it seems it's not possible at all.

My showcase/gallery using Zen Cart - Summerdew

9 May 2007, 12:51 PM
#6
battra avatar

battra

New Zenner

Join Date:
May 2007
Posts:
24
Plugin Contributions:
0

Re: Category name in product info page

Update: I forgot to enable 'Navigation Includes Category Position' in admin and that's why the variable is empty. It works now :)

My showcase/gallery using Zen Cart - Summerdew

9 May 2007, 12:52 PM
#7
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Category name in product info page

Thanks for the update and letting us know the solution ... :smile:

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!