Post by Xsecrets » Tue Jul 12, 2011 11:09 am

iamandy wrote:Okay! When I try your mod, with vqmod.. it just loads my page up as a blank white page. This must be a bug, right?
well it's definitely a bug, but I now I've tried that vqmod on a couple of installs as well as a few other people without issue. Have you made any changes to your core files? Do you have access to your server logs? If you are getting a blank white page it is usually because of a php fatal error and the server logs should tell you what it is.

OpenCart commercial mods and development http://spotonsolutions.net
Layered Navigation
Shipment Tracking
Vehicle Year/Make/Model Filter


Guru Member

Posts

Joined
Sun Oct 25, 2009 3:51 am
Location - FL US

Post by asphole » Fri Jul 15, 2011 1:08 am

Hi Iamandy,

Edit Catalog>View>Theme>Your_Template>Template>Product>Category.tpl
Find:

Code: Select all

<li><a href="<?php echo $category['href']; ?>"><?php echo $category['name']; ?></a></li>
(Around line 25)

Replace with:

Code: Select all

<li> <a href="<?php echo $category['href']; ?>" alt="<?php echo $category['name']; ?>" title="<?php echo $category['name']; ?>"><img src="<?php echo $category['thumb']; ?>"  /></a><br />
      <a href="<?php echo $category['href']; ?>"><?php echo $category['name']; ?></a><br /><br /></li>
This should give you sub category images too. (I'm in the middle of rebuilding 10 websites and a motorcycle so when im clear I'll look into Qmod to do this unless someone wants to step in 1st)

Good Luck.

Active Member

Posts

Joined
Mon Mar 14, 2011 9:33 am

Post by tubbles » Sat Jul 16, 2011 5:22 pm

Hi asphole, that code has worked great, but I was wondering if there was a way to make it spread across the page rather than show bullet points? (sorry I'm a total newb!) So to make it into a table type form?

Newbie

Posts

Joined
Sat Jul 16, 2011 5:12 pm

Post by Ozfarmer » Tue Aug 23, 2011 8:56 am

Well done! works fine for me the only problem I have is the titles are above the images any way to change that?

Active Member

Posts

Joined
Wed Aug 17, 2011 7:08 pm
Location - Australia

Post by asphole » Tue Aug 23, 2011 9:30 am

Hi,


Yes use this:

<li><a href="<?php echo $categories[$i]['href']; ?>" alt="<?php echo $categories[$i]['name']; ?>" title="<?php echo $categories[$i]['name']; ?>"><img src="<?php echo $categories[$i]['thumb']; ?>" /></a><br /><a href="<?php echo $categories[$i]['href']; ?>"><?php echo $categories[$i]['name']; ?></a> </li>

This puts image above name.

Active Member

Posts

Joined
Mon Mar 14, 2011 9:33 am

Post by Ozfarmer » Thu Aug 25, 2011 8:24 am

Thanks Apshole, for some reason it errored, also some of my categories are horizontal and some vertical any ideas what might be causing that? (see attached) Possibly due to modules?

All the best

Paul

Attachments

cat1.JPG

cat1.JPG (33.56 KiB) Viewed 1786 times

cat.JPG

cat.JPG (21.07 KiB) Viewed 1786 times


Active Member

Posts

Joined
Wed Aug 17, 2011 7:08 pm
Location - Australia

Post by asphole » Thu Aug 25, 2011 10:00 am

Yes, you need to remove the <ul><li></li></ul> parts from the code. Here's the code from one of mine:

Code: Select all

    <!-- <ul> --> (Just commented out so you can see where it was.)
      <?php foreach ($categories as $category) { ?>

<div class="box-home">
  <div class="box-heading"><a href="<?php echo $category['href']; ?>"><?php echo $category['name']; ?></a></div>
  <div class="box-content">
    <div class="box-product">
    
<p><a href="<?php echo $category['href']; ?>" alt="<?php echo $category['name']; ?>" title="<?php echo $category['name']; ?>"><img src="<?php echo $category['thumb']; ?>" style="float:left; padding: 5px 50px 5px 0px" /></a><a href="<?php echo $category['href']; ?>"><?php echo $category['name']; ?></a><br /><br /></p><p><a href="<?php echo $category['href']; ?>" alt="<?php echo $category['name']; ?>" title="<?php echo $category['name']; ?>">Click Here to view the complete product range from the category: <?php echo $category['name']; ?></a><br /></p><div style="float:right; margin:20px 5px 0px 0px"><a href="<?php echo $category['href']; ?>">View Products</a></div>

     </div>
  </div>
</div> 

      <?php } ?>
 <!--   </ul> -->
Obviously your stylesheet will be different so it might look like cr*p to start with but that should get you started.

Active Member

Posts

Joined
Mon Mar 14, 2011 9:33 am

Post by asphole » Thu Aug 25, 2011 10:05 am

Here's the original code:

Code: Select all

    <ul>
      <?php foreach ($categories as $category) { ?>
      <li><a href="<?php echo $category['href']; ?>"><?php echo $category['name']; ?></a></li>
      <?php } ?>
    </ul>
Lines 23-27.

They're just formatted as list items so you can format however you want, div's/tables etc.

Active Member

Posts

Joined
Mon Mar 14, 2011 9:33 am

Post by Landho » Sat Sep 10, 2011 6:34 am

I just upgraded OpenCart from 1.5 to 1.5.1, having an issue with this tweak and getting an error in the Refined Search box now after upgrade...

Undefined index: thumb

Anyone else seeing that? I am a total OpenCart newbie, trying to find the solution myself - but I could use a little help.

Newbie

Posts

Joined
Sun Jul 10, 2011 1:34 am
Who is online

Users browsing this forum: No registered users and 25 guests