Post by vinhpk » Sat Dec 29, 2012 12:32 pm

Deal all,

My categories and their child have layout below:

Code: Select all

- PC Components 
     PC Components -> CPU
     PC Components -> Mainboard
     PC Components -> RAM
     PC Components -> VGA
- Notebook
     Notebook -> Asus
     Notebook -> MSI
     Notebook -> Lenovo
     Notebook -> Dell
- Accessories
    Accessories -> Cable
    Accessories -> Fan
    Accessories -> Heatsink
by default, my category display on website such as:

Code: Select all

- PC Components 
- Notebook
- Accessories
but now I want display them as:

Code: Select all

- PC Components 
      CPU
      Mainboard
      RAM
      VGA
- Notebook
      Asus
      MSI
      Lenovo
      Dell
- Accessories
     Cable
     Fan
     Heatsink
It seem I can list all of sub-categories without click in parent category. I tried this below but nothing change:
In catalog\view\theme\default\template\module, I replace this:

Code: Select all

<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 { ?>
          <a href="<?php echo $category['href']; ?>"><?php echo $category['name']; ?></a>
          <?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>
with this:

Code: Select all

<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 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 } ?>
          <?php } else { ?>
          <a href="<?php echo $category['href']; ?>"><?php echo $category['name']; ?></a>
          <?php } ?>
        </li>
        <?php } ?>
      </ul>
    </div>
  </div>
</div>
Do I wrong? Can somebody help me handle this problem?

New member

Posts

Joined
Sat Dec 29, 2012 12:13 pm

Post by ChetanCx » Mon Dec 31, 2012 4:39 am

i don't know what i you have done (you know its very hard to look at someone's code ) so just replace the code with this and it should be working.

Code: Select all

<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>
          <a href="<?php echo $category['href']; ?>" class="active"><?php echo $category['name']; ?></a>
          <?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>
and as i see you sell RAMs so if this works for you i want 4GB RAM free lol :laugh: :laugh: O0 (just kidding)

User avatar
Active Member

Posts

Joined
Sat Dec 08, 2012 8:12 pm

Post by vinhpk » Mon Jan 07, 2013 12:50 pm

ChetanCx wrote:i don't know what i you have done (you know its very hard to look at someone's code ) so just replace the code with this and it should be working.

Code: Select all

<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>
          <a href="<?php echo $category['href']; ?>" class="active"><?php echo $category['name']; ?></a>
          <?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>
and as i see you sell RAMs so if this works for you i want 4GB RAM free lol :laugh: :laugh: O0 (just kidding)
Oh, many thanks, it's really work. And if you are in Vietnam, I am ready to sent you a free RAM :drunk:

New member

Posts

Joined
Sat Dec 29, 2012 12:13 pm

Post by ChetanCx » Mon Jan 07, 2013 3:47 pm

vinhpk wrote: Oh, many thanks, it's really work. And if you are in Vietnam, I am ready to sent you a free RAM :drunk:
oh, i live in India ,close enough,may be later when your business grows and you start shipping international :yahoo:

User avatar
Active Member

Posts

Joined
Sat Dec 08, 2012 8:12 pm

Post by matteoraggi » Fri Jan 18, 2013 2:39 am

How to make it work as a vqmod?

http://www.restaurantsupplies.eu Restaurant Supplies
Opencart 1.5.6.4 VQMOD 2.4.1
Languages: Italian, French, German, Hungarian, English, Russian, Polish and Spanish


Active Member

Posts

Joined
Fri Apr 10, 2009 8:16 pm

Post by ChetanCx » Fri Jan 18, 2013 11:30 pm

matteoraggi wrote:How to make it work as a vqmod?
search first line of code, then use "replace" and offset to replace all code of the file with this code.

User avatar
Active Member

Posts

Joined
Sat Dec 08, 2012 8:12 pm

Post by matteoraggi » Sat Jan 19, 2013 3:18 am

You are right, but I?m not a coder. Could someone to paste here the code of the vqmod xml file?

http://www.restaurantsupplies.eu Restaurant Supplies
Opencart 1.5.6.4 VQMOD 2.4.1
Languages: Italian, French, German, Hungarian, English, Russian, Polish and Spanish


Active Member

Posts

Joined
Fri Apr 10, 2009 8:16 pm

Post by ChetanCx » Sat Jan 19, 2013 3:50 am

matteoraggi wrote:You are right, but I?m not a coder. Could someone to paste here the code of the vqmod xml file?
download it from here
http://forum.opencart.com/viewtopic.php?f=131&t=93236

User avatar
Active Member

Posts

Joined
Sat Dec 08, 2012 8:12 pm
Who is online

Users browsing this forum: No registered users and 2 guests