Post by pumpkinpatch » Sun Nov 13, 2011 9:24 am

Hi There,
I am using V 1.5.1.3 and I would like when you select a category for it to display the pictures on the sub category.
Is this possible?
http://www.thepumpkinpatch.ca
Thanks
Lisa
Last edited by pumpkinpatch on Mon Nov 14, 2011 9:04 am, edited 1 time in total.

New member

Posts

Joined
Wed Jun 22, 2011 1:13 am

Post by grgr » Sun Nov 13, 2011 5:04 pm

Do you mean the 'Refine Search'? If so then click link below.

-
Image Image Image Image
VIEW ALL EXTENSIONS * EXTENSION SUPPORT * WEBSITE * CUSTOM REQUESTS


User avatar
Active Member

Posts

Joined
Mon Mar 28, 2011 4:08 pm
Location - UK

Post by pprmkr » Sun Nov 13, 2011 6:24 pm

I altered for you the catalog/controller/catalog.php and the catalog.tpl

It shows the category image with the name as link to the subcategory.

Please backup the existing files before you upload the ones in the archive.

Attachments

Extract and upload after backup of existing


User avatar
Active Member

Posts

Joined
Sat Jan 08, 2011 11:05 pm
Location - Netherlands

Post by pumpkinpatch » Mon Nov 14, 2011 9:04 am

It works perfectly thanks so much!!

New member

Posts

Joined
Wed Jun 22, 2011 1:13 am

Post by jontycasson » Thu Mar 22, 2012 3:42 am

Works with 1.5.2.1 as well as I have just used it again!

Image
Vidal Cassoon - Hair and Beauty Specialists


New member

Posts

Joined
Wed Apr 13, 2011 2:01 am
Location - Cheshire

Post by chris.dempsey » Wed Apr 04, 2012 6:47 pm

Created XML file for vQmod v2.1.5 from the work by pprmkr. Tested on OpenCart v1.5.1.3.

Going by jontycasson's post above it should also work with v1.5.2.1 as well.

Attachments


New member

Posts

Joined
Wed Apr 04, 2012 6:43 pm

Post by gennady » Fri Apr 06, 2012 10:51 pm

With vQmod in subcategory
Notice: Undefined variable: result in mystore/vqmod/vqcache/vq2-catalog_controller_product_category.php on line 164

http://www.hobby-miracle.com


Newbie

Posts

Joined
Tue Oct 27, 2009 9:58 pm
Location - Ukraine, Kharkov

Post by straightlight » Fri Apr 06, 2012 11:00 pm

Without knowing exactly if the following will fix the $result error message but what can be noticed is a bug from the XML:

Code: Select all

<file name="catalog/controller/product/category.php">
    <operation>
      <search position="after">
for:

Code: Select all

<file name="catalog/controller/product/category.php">
    <operation>
      <search position="after" index="1">

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by chris.dempsey » Wed May 02, 2012 6:55 pm

@Straightlight: you are correct, I added the same file to a different OpenCart install today (same version) and the error noted by gennady appeared. Adding index="1" resolves this but unsure why the error is not apparent on the first install I applied this to. Could be a combination of other vQmod files removing the second instance of the search term before this mod is parsed.

New member

Posts

Joined
Wed Apr 04, 2012 6:43 pm

Post by straightlight » Wed May 02, 2012 10:27 pm

Could be a combination of other vQmod files removing the second instance of the search term before this mod is parsed.
As I explained on other few topics, VQMod can be full of surprises while one or a few thinks there are actually no problems with the core. Most definitely, the quoted question sentence above is correct; there are currently no way - full proof - of knowing how or when a contribution could get or be conflicted with another contribution at this time nor there is a real reliable event tracker other than the VQMod logs or the OC logs from the admin which is still a non-proof method to track 'each' contributions when a conflict is involved which is the definite cause and started issues on why OC merchants wonders of the dis-functionality of distributors contribution most of the time when it isn't about coding issues.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by Calcite » Thu May 03, 2012 2:37 am

This works great for me with 1.5.2.1 but my custom theme floats the image left so all are stacked in a column above each other. I'm not good at code so wonder how I might display them like a grid view?

Active Member

Posts

Joined
Fri Dec 30, 2011 3:21 am

Post by pprmkr » Thu May 03, 2012 2:51 pm

The default them also floats the .category_info .image to the left.

Did you put the extra <div> around the category info?

Code: Select all

      <?php foreach ($categories as $category) { ?>
      <div>
      	<div class="image">
      		<?php if ( $category['image']){?>
      		<a href="<?php echo $category['href']; ?>"><img src="<?php echo $category['image'];?>" /></a>
      		<?php } ?>	
      	</div>
      	<div class="name">
      		<a href="<?php echo $category['href']; ?>"><?php echo $category['name']; ?></a>
      	</div>
      </div>
      <?php } ?>

User avatar
Active Member

Posts

Joined
Sat Jan 08, 2011 11:05 pm
Location - Netherlands

Post by Calcite » Thu May 03, 2012 8:23 pm

I'm not good at this stuff so not sure where in the code you mean?

Here is the section from my existing XML fille

Code: Select all

  <?php foreach ($categories as $category) { ?>
          <div>
          <div class="image">
          <?php if ( $category['image']){?>
          <a href="<?php echo $category['href']; ?>"><img src="<?php echo $category['image'];?>" /></a>
          <?php } ?>	
          </div>
          <div class="name">
          <a href="<?php echo $category['href']; ?>"><?php echo $category['name']; ?></a>
          
          </div>
          </div>
          <?php } ?>
          </div>
          <?php } ?>]]>

Active Member

Posts

Joined
Fri Dec 30, 2011 3:21 am

Post by pprmkr » Thu May 03, 2012 10:26 pm

I count 1 closing </div> more than opening <div>
Where does that come from?

Can you post a link to your website, so I can take a look?

User avatar
Active Member

Posts

Joined
Sat Jan 08, 2011 11:05 pm
Location - Netherlands

Post by Calcite » Fri May 04, 2012 2:03 am

Unfortunately I am running on a local server and am just developing the site at the moment.

The code I posted comes directly from the Zip file posted by chris.dempsey further up this thread.

Active Member

Posts

Joined
Fri Dec 30, 2011 3:21 am

Post by pprmkr » Fri May 04, 2012 3:22 pm

The code looks OK.
But also unfortunate, I don't use VQMod, so I cannot test the XML.

Can you send me your theme, so I can test it on my local server?

User avatar
Active Member

Posts

Joined
Sat Jan 08, 2011 11:05 pm
Location - Netherlands

Post by Calcite » Mon May 07, 2012 5:53 pm

First the bad news, then the good!

Things have taken a U turn as my partner wants to use a different template :(

I tried the Vqmod in the new template and it works fine :banana:

Active Member

Posts

Joined
Fri Dec 30, 2011 3:21 am

Post by alex1 » Sat May 26, 2012 12:10 pm

Does this work with 1.5.3?

Active Member

Posts

Joined
Sat Oct 16, 2010 9:49 am

Post by pprmkr » Mon May 28, 2012 4:19 pm

Yes, it works in 1.5.3

In the controller

Code: Select all

				$product_total = $this->model_catalog_product->getTotalProducts($data);
				if ($result['image']) {
					$image = $this->model_tool_image->resize($result['image'], $this->config->get('config_image_category_width'), $this->config->get('config_image_category_height'));
				} else {
					$image = false;
				}
				
				$this->data['categories'][] = array(
					'name'  => $result['name'] . ' (' . $product_total . ')',
					'image' => $image,
					'href'  => $this->url->link('product/category', 'path=' . $this->request->get['path'] . '_' . $result['category_id'] . $url)
				);
In the template:

Code: Select all

  <?php if ($categories) { ?>
  <h2><?php echo $text_refine; ?></h2>
  <div>
      <?php foreach ($categories as $category) { ?>
      <div style="width: 130px; display: inline-block; vertical-align: top; margin-right: 20px; margin-bottom: 15px;">
      	<div class="image">
      		<?php if ( $category['image']){?>
      		<a href="<?php echo $category['href']; ?>"><img src="<?php echo $category['image'];?>" /></a>
      		<?php } ?>	
      	</div>
      	<div class="name">
      		<a href="<?php echo $category['href']; ?>"><?php echo $category['name']; ?></a>
      	</div>
      </div>
      <?php } ?>
  </div>
  <?php } ?>

User avatar
Active Member

Posts

Joined
Sat Jan 08, 2011 11:05 pm
Location - Netherlands

Post by mmacpheat » Tue Nov 06, 2012 9:51 pm

Does anyone know if this works with 1.5.4.1

Newbie

Posts

Joined
Tue Dec 22, 2009 8:37 pm
Who is online

Users browsing this forum: edkny and 113 guests