1.5 Subcategory Images
1.5 Subcategory Images
In the older version, I could add an image to my Subcategories, and when someone would click the parent category of that sub cat, You would see a listing of just those images with the "title" of that sub category.
In this version, I go to the Parent Category, but instead of seeing images of a listing of my sub categories, I see a "Refine Search" and a text link of my sub category. I have an image attached to just the sub category. Do you know if there is a way to make this like it once was?
Thanks!
In this version, I go to the Parent Category, but instead of seeing images of a listing of my sub categories, I see a "Refine Search" and a text link of my sub category. I have an image attached to just the sub category. Do you know if there is a way to make this like it once was?
Thanks!
- muddysmurf
- Posts: 7
- Joined: Mon Jun 27, 2011 9:06 pm
Re: 1.5 Subcategory Images
Noticed this one also when comparing to 1.4.9.x. Anyone (Q/Daniel) with a solution for this one?
The Finnish OpenCart Forum | Finnish OpenCart Add-ons
"Real programmers don't document. If it was hard to write, it should be hard to understand."
"Real programmers don't document. If it was hard to write, it should be hard to understand."
- Miguelito
- Posts: 807
- Joined: Sun Jan 10, 2010 2:11 pm
Re: 1.5 Subcategory Images
yeah unfortunately there's no quick solution. It involves some coding. I did it for one customer already. I may release a vqmod when I get a break.
OpenCart commercial mods and development http://spotonsolutions.net
Layered Navigation
Shipment Tracking
Vehicle Year/Make/Model Filter
Layered Navigation
Shipment Tracking
Vehicle Year/Make/Model Filter
- Xsecrets
- Posts: 5042
- Joined: Sat Oct 24, 2009 7:51 pm
- Location: FL US
Re: 1.5 Subcategory Images
I would love for this to be a mod -- or for someone to point me in the right direction on how to code it. This will help my store out!
- muddysmurf
- Posts: 7
- Joined: Mon Jun 27, 2011 9:06 pm
Re: 1.5 Subcategory Images
Hi
Here is my attempt at changing the display- there is a bit of extra css in there which isn't used in the default install.
This changes the list to divs and puts in the images.
Probably a much better way of doing this than I have here, but its the best I can manage - improvements welcome!
This is for 1.5.0.5
Thanks
Rob
Here is my attempt at changing the display- there is a bit of extra css in there which isn't used in the default install.
This changes the list to divs and puts in the images.
Probably a much better way of doing this than I have here, but its the best I can manage - improvements welcome!
This is for 1.5.0.5
Thanks
Rob
- Attachments
-
subcat_images.xml- re-uploaded so uses default template
- (1.64 KiB) Downloaded 1218 times
- teratyke
- Posts: 202
- Joined: Sun Jun 12, 2011 7:05 am
Re: 1.5 Subcategory Images
teratyke:
Took a little work on my part (lot more work on your part though), but I got it working. Thank you so much!!
Took a little work on my part (lot more work on your part though), but I got it working. Thank you so much!!
- muddysmurf
- Posts: 7
- Joined: Mon Jun 27, 2011 9:06 pm
Re: 1.5 Subcategory Images
I'd highly suggest adding a </div> in there.. as the footer appears in the product table because it hasn't been closed off!
- iamandy
- Posts: 27
- Joined: Wed Jun 22, 2011 3:19 pm
Re: 1.5 Subcategory Images
Thanks for the feedback. I can't find a missing </div> nor do I see the error you mention when I browse my site (sorry its not live). Its possible I have made some other edit to the category.tpl file, that is hiding it from me, but I don't think so. I just checked the vqmod cached file and all the divs seem to match up. I'm using the base install of 1.5.05, no svn's applied.
Any ideas?
Any ideas?
- teratyke
- Posts: 202
- Joined: Sun Jun 12, 2011 7:05 am
Re: 1.5 Subcategory Images
I see.
I've also ran into another problem.. I have one product on my site, but when you click on the sub cat for the product, it doesn't load up.. Any ideas?
I've also ran into another problem.. I have one product on my site, but when you click on the sub cat for the product, it doesn't load up.. Any ideas?
- iamandy
- Posts: 27
- Joined: Wed Jun 22, 2011 3:19 pm
Re: 1.5 Subcategory Images
iamandy wrote:I see.
Sorry, I don't follow...
I've also ran into another problem.. I have one product on my site, but when you click on the sub cat for the product, it doesn't load up.. Any ideas?
Is your site live? Posting a link would make it easier to help, or even what is happening when you click the product. Don't have a lot to go on at the moment.
- teratyke
- Posts: 202
- Joined: Sun Jun 12, 2011 7:05 am
Re: 1.5 Subcategory Images
Yes, I do..
Footballs is the main one it does it on. Check Adidas, Mitre and Nike.
http://firstsportsdirect.co.uk/equipment/footballs
Footballs is the main one it does it on. Check Adidas, Mitre and Nike.
http://firstsportsdirect.co.uk/equipment/footballs
- iamandy
- Posts: 27
- Joined: Wed Jun 22, 2011 3:19 pm
Re: 1.5 Subcategory Images
Perhaps try turning SEO urls off, then test.
Its odd.
I wonder if your SEO urls aren't unique, or something like that.
Its odd.
I wonder if your SEO urls aren't unique, or something like that.
- teratyke
- Posts: 202
- Joined: Sun Jun 12, 2011 7:05 am
Re: 1.5 Subcategory Images
Yeah, that seemed to have done the trick! Thanks
- iamandy
- Posts: 27
- Joined: Wed Jun 22, 2011 3:19 pm
Re: 1.5 Subcategory Images
The code seems to have changed a fair bit in 1.5.1, does anyone know how to get this to work?
Get it here Google Analytics Expert - E-Commerce Tracking including Product Options, Goal & Funnel Reporting, Event Tracking, Search Tracking, Multi-Store compatibility & EU Cookie Law compliance. Works with Shoppica too!
Free Mods:
Remove Wishlist | Remember text in search box
Other Extensions:
Remove product counts, Opencart speedup & Improve page load time | All Extensions
-

spitos - Posts: 258
- Joined: Mon May 23, 2011 10:19 am
- Location: UK
Re: 1.5 Subcategory Images
Do you mean how to get the VQmod to work? For me at least it does work in 1.5.1.1. What problem are you having?
- teratyke
- Posts: 202
- Joined: Sun Jun 12, 2011 7:05 am
Re: 1.5 Subcategory Images
I've installed the vqmod but all i got was a blank category page.
I looked at the xml file and compared it against the file that gets changed but the code cannot be found:
I looked at the xml file and compared it against the file that gets changed but the code cannot be found:
- Code: Select all
<file name="catalog/controller/product/category.php">
<operation>
<search position="after"><![CDATA[
$product_total = $this->model_catalog_product->getTotalProducts(array('filter_category_id' => $result['category_id']));
]]></search>
<add><![CDATA[
$image = $this->model_tool_image->resize($result['image'], $this->config->get('config_image_category_width'), $this->config->get('config_image_category_height'));
]]></add>
</operation>
Get it here Google Analytics Expert - E-Commerce Tracking including Product Options, Goal & Funnel Reporting, Event Tracking, Search Tracking, Multi-Store compatibility & EU Cookie Law compliance. Works with Shoppica too!
Free Mods:
Remove Wishlist | Remember text in search box
Other Extensions:
Remove product counts, Opencart speedup & Improve page load time | All Extensions
-

spitos - Posts: 258
- Joined: Mon May 23, 2011 10:19 am
- Location: UK
Re: 1.5 Subcategory Images
Should've mentioned that i downloaded the latest SVN today to fix some bugs, just looked at my old 1.5.1.1 file and the code is in there. The SVN version of the file has it formatted differently.
In the file before i updated to the SVN, the code is this:
But the latest version has the code like this:
Any ideas?
In the file before i updated to the SVN, the code is this:
- Code: Select all
$this->data['categories'] = array();
$results = $this->model_catalog_category->getCategories($category_id);
foreach ($results as $result) {
$product_total = $this->model_catalog_product->getTotalProducts(array('filter_category_id' => $result['category_id']));
$this->data['categories'][] = array(
'name' => $result['name'] . ' (' . $product_total . ')',
'href' => $this->url->link('product/category', 'path=' . $this->request->get['path'] . '_' . $result['category_id'] . $url)
);
}
But the latest version has the code like this:
- Code: Select all
$this->data['categories'] = array();
$results = $this->model_catalog_category->getCategories($category_id);
foreach ($results as $result) {
$data = array(
'filter_category_id' => $result['category_id'],
'filter_sub_category' => true
);
$product_total = $this->model_catalog_product->getTotalProducts($data);
$this->data['categories'][] = array(
'name' => $result['name'] . ' (' . $product_total . ')',
'href' => $this->url->link('product/category', 'path=' . $this->request->get['path'] . '_' . $result['category_id'] . $url)
);
}
Any ideas?
Get it here Google Analytics Expert - E-Commerce Tracking including Product Options, Goal & Funnel Reporting, Event Tracking, Search Tracking, Multi-Store compatibility & EU Cookie Law compliance. Works with Shoppica too!
Free Mods:
Remove Wishlist | Remember text in search box
Other Extensions:
Remove product counts, Opencart speedup & Improve page load time | All Extensions
-

spitos - Posts: 258
- Joined: Mon May 23, 2011 10:19 am
- Location: UK
Re: 1.5 Subcategory Images
The problem with the VQmod I made is it finds a line and replaces it and the next 22 line. That might need adjusted for this new version. I've just lost ftp access to my host so I can't check at the moment. I'll get back to you as soon as I sort this ftp problem out.
THanks
THanks
- teratyke
- Posts: 202
- Joined: Sun Jun 12, 2011 7:05 am
Re: 1.5 Subcategory Images
Ah ok I just checked the svn - try this - dont forget to rename the old vqmod first - might be handy to keep both, but only enable one..
- Attachments
-
subcat_images2.xml- (1.59 KiB) Downloaded 454 times
- teratyke
- Posts: 202
- Joined: Sun Jun 12, 2011 7:05 am
Re: 1.5 Subcategory Images
Thanks for the quick reply, I was unable to test properly until this morning.
I tried with the new file you sent but still couldn't get it to work and just had a blank page, so I made a few changes and managed to get it working properly.
I changed the search position and search text in the first operation, as well as what it adds so what used to be this:
Is now:
Thanks for the pointers.
You can test my version here, definitely works for me:
I tried with the new file you sent but still couldn't get it to work and just had a blank page, so I made a few changes and managed to get it working properly.
I changed the search position and search text in the first operation, as well as what it adds so what used to be this:
- Code: Select all
<file name="catalog/view/theme/default/template/product/category.tpl">
<operation>
<search position="replace" offset="22"><![CDATA[<?php if ($categories) { ?>]]></search>
<add><![CDATA[
<?php if ($categories) { ?>
<div class="box">
<div class="box-heading"><?php echo $text_refine; ?></div>
<div class="box-content">
<div class="box-product box-subcat">
<?php foreach ($categories as $category) { ?>
<div>
<?php if ($category['thumb']) { ?>
<div class="image"><a href="<?php echo $category['href']; ?>"><img src="<?php echo $category['thumb']; ?>" alt="<?php echo $category['name']; ?>" /></a></div>
<?php } ?>
<div class="name subcatname"><a href="<?php echo $category['href']; ?>"><?php echo $category['name']; ?></a></div>
</div>
<?php } ?>
</div>
</div>
</div>
<?php } ?>
]]></add>
</operation>
</file>
Is now:
- Code: Select all
<file name="catalog/view/theme/default/template/product/category.tpl">
<operation>
<search position="replace" offset="24"><![CDATA[<h2><?php echo $text_refine; ?></h2>]]></search>
<add><![CDATA[
<div class="box">
<div class="box-heading"><?php echo $text_refine; ?></div>
<div class="box-content">
<div class="box-product box-subcat">
<?php foreach ($categories as $category) { ?>
<div>
<?php if ($category['thumb']) { ?>
<div class="image"><a href="<?php echo $category['href']; ?>"><img src="<?php echo $category['thumb']; ?>" alt="<?php echo $category['name']; ?>" /></a></div>
<?php } ?>
<div class="name subcatname"><a href="<?php echo $category['href']; ?>"><?php echo $category['name']; ?></a></div>
</div>
<?php } ?>
</div>
</div>
</div>
]]></add>
</operation>
</file>
Thanks for the pointers.
You can test my version here, definitely works for me:
- Attachments
-
subcat_images2.xml- (1.61 KiB) Downloaded 782 times
Get it here Google Analytics Expert - E-Commerce Tracking including Product Options, Goal & Funnel Reporting, Event Tracking, Search Tracking, Multi-Store compatibility & EU Cookie Law compliance. Works with Shoppica too!
Free Mods:
Remove Wishlist | Remember text in search box
Other Extensions:
Remove product counts, Opencart speedup & Improve page load time | All Extensions
-

spitos - Posts: 258
- Joined: Mon May 23, 2011 10:19 am
- Location: UK
Who is online
Users browsing this forum: blackpink, cars111, dionysus, eurekasprings, Goliath, labeshops, Maeploy, midgette, paulfeakins, rwenve, ShaneTFletcher, tomatito, uncommonhound and 86 guests













