Post by justinesmithies » Sun Jan 13, 2013 12:46 am

I have a tpl page which only displays the top level categories in the drop down menu, the code is below.
How do i change it to show all sub categories too ?

Code: Select all

<tr>
              <td><?php echo $entry_category; ?></td>
              <td>
                  <?php $class = 'odd'; ?>
				   <div class="<?php echo $class; ?>">
				  <select name="extcategory" id="extcategory">
                  <?php foreach ($categories as $category) { ?>                          
                    <?php if (in_array($category['category_id'], $product_category)) { ?>					
					<option value="<?php echo $category['category_id']; ?>" selected="selected"><?php echo $category['name']; ?></option>					                                 
                    <?php } else { ?>
                    <option value="<?php echo $category['category_id']; ?>"><?php echo $category['name']; ?></option>
				      <?php } ?>
                     <?php } ?>
				  </select> 
				  </div>
               
               </td>
            </tr>
Any help would be very much appreciated.

Thanx
Justine

User avatar

Posts

Joined
Sun Dec 23, 2012 5:31 am
Who is online

Users browsing this forum: No registered users and 35 guests