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

              <td><?php echo $entry_category; ?></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 } ?>
Any help would be very much appreciated.


User avatar


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

Users browsing this forum: No registered users and 46 guests