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!
The Finnish OpenCart Forum
"Real programmers don't document. If it was hard to write, it should be hard to understand."
OpenCart commercial mods and development http://spotonsolutions.net
Layered Navigation
Shipment Tracking
Vehicle Year/Make/Model Filter
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
re-uploaded so uses default template
Took a little work on my part (lot more work on your part though), but I got it working. Thank you so much!!
Any ideas?
Sorry, I don't follow...iamandy wrote:I see.
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.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?
Footballs is the main one it does it on. Check Adidas, Mitre and Nike.
http://firstsportsdirect.co.uk/equipment/footballs
Google Analytics Expert - Advanced e-commerce tracking, Product & options reporting, transaction/conversion reporting, Google Adwords conversion & profit reporting, goal & funnel reporting, event tracking, site search tracking, multi-store compatibility, EU Cookie Law compliance and works with any theme or checkout! Easy vqmod install. Get it here
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>
Google Analytics Expert - Advanced e-commerce tracking, Product & options reporting, transaction/conversion reporting, Google Adwords conversion & profit reporting, goal & funnel reporting, event tracking, site search tracking, multi-store compatibility, EU Cookie Law compliance and works with any theme or checkout! Easy vqmod install. Get it here
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)
);
}
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)
);
}
Google Analytics Expert - Advanced e-commerce tracking, Product & options reporting, transaction/conversion reporting, Google Adwords conversion & profit reporting, goal & funnel reporting, event tracking, site search tracking, multi-store compatibility, EU Cookie Law compliance and works with any theme or checkout! Easy vqmod install. Get it here
THanks
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>
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>
You can test my version here, definitely works for me:
Google Analytics Expert - Advanced e-commerce tracking, Product & options reporting, transaction/conversion reporting, Google Adwords conversion & profit reporting, goal & funnel reporting, event tracking, site search tracking, multi-store compatibility, EU Cookie Law compliance and works with any theme or checkout! Easy vqmod install. Get it here
Users browsing this forum: No registered users and 27 guests