0

I have a website I manage for a mens clothing store, at www.malefashionsco.com. On the home page, if you click one of the tuxedo categories, you'll see it says "category not found". I have created the categories on the backend of the ecommerce platform, but they do not show. There should be a page for each of the tuxedos, also, once in the category, the left sidebar menu should have the categories listed. An example is at

http://www.malefashionsco.com/index.php?route=product/category&path=9

Here is the code for the menu:

<div class="box">
<div class="box-heading"><?php echo $heading_title; ?></div>
<div class="box-content">
<div class="box-category">
  <ul>
    <?php foreach ($categories as $category) { ?>
    <li>
      <?php if ($category['category_id'] == $category_id) { ?>
      <a href="<?php echo $category['href']; ?>" class="active"><?php echo      $category['name']; ?></a>
      <?php } else { ?>

      <?php } ?>
      <?php if ($category['children']) { ?>
      <ul>
        <?php foreach ($category['children'] as $child) { ?>
        <li>
          <?php if ($child['category_id'] == $child_id) { ?>
          <a href="<?php echo $child['href']; ?>" class="active"> - <?php echo $child['name']; ?></a>
          <?php } else { ?>
          <a href="<?php echo $child['href']; ?>"> - <?php echo $child['name']; ?></a>
          <?php } ?>
        </li>
        <?php } ?>
        </ul>
        <?php } ?>
        </li>
       <?php } ?>
      </ul>
     </div>
   </div>
 </div>

PHP is not my strong suit. What would the code look like to put in the <li> to create the links?

7
  • Looking at the code I don't see anything wrong. Where does $categories come from? Commented Jan 16, 2013 at 18:28
  • 2
    eww, inline php with html Commented Jan 16, 2013 at 18:54
  • @Bot what's wrong with that? Commented Jan 16, 2013 at 18:55
  • 2
    @Growler what's right with it? Commented Jan 16, 2013 at 18:55
  • Mixing PHP and HTML != to mixing peanut butter and jelly. It's just gross. Commented Jan 16, 2013 at 19:01

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.