View Single Post
  #1  
Old 01-17-2005, 12:47 PM
  amy2203's Avatar 
amy2203 amy2203 is offline
 

X-Wizard
  
Join Date: Jul 2004
Location: Watford, UK
Posts: 1,509
 

Default How do I get a category name from the categoryid?

I'm trying to create a page where I can see all of a products categories, and change and modify as necessary. I have a copy of the search.php and made the necessary changes so it calls new templates that are solely in the admin area. It is pulling the category ids from the products table, and displaying them at the top of a drop down box with all of the categories in, but when it displays, it is just the category number, as this is what is held in the products table. This is the code I have:

Code:
<td height="10"> <select name="category1"> <option value="{$products[cat_num].categoryid1}">{$products[cat_num].categoryid1}</option> {section name=cat_options_2 loop=$allcategories} <option value={$allcategories[cat_options_2].categoryid}>{$allcategories[cat_options_2].category}</option> {/section} </select> </td>

I tried assigning a variable called catid with the value $products[cat_num].categoryid1 and then using
Code:
<option value="{$products[cat_num].categoryid1}">{$categories[catid].category}</option>

but that just displayed nothing, Can anyone tell me how I can display the category name.

Thanks

Amy
__________________
X-Cart version 5 (Previously 3.5-4)

Previous Versions included
BCSE Reward Points Mod
Altered Cart On Sale Mod
Wordpress Plugin

Please don't PM me for support. I help where I can on the forum and your question will more likely be answered there.

Shout me a Coffee!
Reply With Quote