Post by Jelle85 » Wed Jul 19, 2017 6:44 am

Because I am rebuilding my webshop from a 1.5.4 version now into a 2.1.0.2 version I get some struggles.
I am a little Autistic so when I have a subcategorie I want boxes with a small picture, like I had in the old version.
But I am not able to find out how to get this to work.

My old, how I would like it, site:
http://shop.taartmonster.nl/index.php?r ... y&path=289

The new one:
http://www.taartmonster.nl/webstoretest ... y&path=190
(I added the pictures but you only see them when you click on one of the subcategories, how can I show them here??)

TIA!!!
Marielle

Building my second webshop with OC 3.0.2.0
https://shop.taartmonster.nl/


Active Member

Posts

Joined
Thu Dec 20, 2012 7:19 pm

Post by IP_CAM » Wed Jul 19, 2017 11:10 am

I have this v.1.5.6.5 resp.Theme IMAGE DECLARATION in the controller/product/category.php file:

Code: Select all

$this->data['categories'][] = array(
'name'  => $result['name'] . ($this->config->get('config_product_count') ? ' (' . $this->model_catalog_product->getTotalProducts($data) . ')' : ''),
--- FROM HERE ---
'image'=>$this->model_tool_image->resize($result['image'], 160,125),
--- TO HERE ---
'href'  => $this->url->link('product/category', 'path=' . $this->request->get['path'] . '_' . $result['category_id'] . $url)
);
wich would (hopefully) look about like this, in your OC v.2.x Version:

Code: Select all

$data['categories'][] = array(
'name'  => $result['name'] . ($this->config->get('config_product_count') ? ' (' . $this->model_catalog_product->getTotalProducts($filter_data) . ')' : ''),
'image'  =>$this->model_tool_image->resize($result['image'], 160,125),
'href'  => $this->url->link('product/category', 'path=' . $this->request->get['path'] . '_' . $result['category_id'] . $url)
);
and this in the theme/template/product/category.tpl file:

Code: Select all

<?php if ($categories) { ?>
<h4><?php echo $text_refine; ?></h4>
<div class="row">
<?php foreach (array_chunk($categories, ceil(count($categories) / 4)) as $categories) { ?>
<div class="col-sm-3">
<div class="list-group">
<?php foreach ($categories as $category) { ?>
<a class="list-group-item" href="<?php echo $category['href']; ?>">
<!-- JTI MOD  SubCat Image -->
<?php if($category['image']){ ?>
<img class="img-thumbnail" src="<?php echo $category['image']; ?>" alt="Category" width="160" height="125" /><br>
  <?php } ?>
<!-- JTI END MOD  SubCat Image -->						  
<?php echo $category['name']; ?></a>
<?php } ?>
</div>
</div>
<?php } ?>
</div>
<?php } ?>
to get what you see on the image below.
At least, if I copied the correct Code .. ::)
Good Luck!
Ernie
---
Image

My Github OC Site: https://github.com/IP-CAM
5'200 + FREE OC Extensions, on the World's largest private Github OC Repository Archive Site.


User avatar
Legendary Member

Posts

Joined
Tue Mar 04, 2014 1:37 am
Location - Switzerland

Post by Jelle85 » Wed Jul 19, 2017 3:48 pm

Hi Ernie,

Thanks for your post, I am not at home right now but will try it tonight!
I will let you know.

Thanks again!

Building my second webshop with OC 3.0.2.0
https://shop.taartmonster.nl/


Active Member

Posts

Joined
Thu Dec 20, 2012 7:19 pm

Post by IP_CAM » Thu Jul 20, 2017 12:13 am

And if the above does not work as planned, check on this one here also: ;)
Sub Category (Refine Search) Images
https://www.opencart.com/index.php?rout ... on_id=3907

My Github OC Site: https://github.com/IP-CAM
5'200 + FREE OC Extensions, on the World's largest private Github OC Repository Archive Site.


User avatar
Legendary Member

Posts

Joined
Tue Mar 04, 2014 1:37 am
Location - Switzerland

Post by Jelle85 » Thu Jul 20, 2017 1:39 am

Ernie, can you help me, do I need to add the code or do I need to replace some?

Building my second webshop with OC 3.0.2.0
https://shop.taartmonster.nl/


Active Member

Posts

Joined
Thu Dec 20, 2012 7:19 pm

Post by Jelle85 » Thu Jul 20, 2017 2:13 am

I am not getting it to work :( :'(

Building my second webshop with OC 3.0.2.0
https://shop.taartmonster.nl/


Active Member

Posts

Joined
Thu Dec 20, 2012 7:19 pm

Post by IP_CAM » Thu Jul 20, 2017 7:08 am

This Information will (hopefully) ONLY work in a Default OC 2.1.0.2 Theme.
In the ZIP File enclosed, you find 2 files, wich shall replace your default controller file in:
1. catalog/controller/product/category.php
and the corresponding default Theme File:
2. catalog/view/theme/default/template/product/category.tpl
---
Rename the existing OC v.2.1.0.2 default files on the Server to:
1. d_category.tpl
2. d_category.php
to still have them available, if you need to change back... :D
and upload the two unzipped modified files into their place instead.
---
Then add some sample images to subcategories, and then,
clear out / Reset your OcModification Section and your VqMod Cache Sub,
and test for Results.
---
Untested, Good Luck ;)
Ernie
PS. I am not sure of hand , if the<br> Tag will work swell in <ul><li> <br> </li></ul> Listings, just to mention this ! 8)

My Github OC Site: https://github.com/IP-CAM
5'200 + FREE OC Extensions, on the World's largest private Github OC Repository Archive Site.


User avatar
Legendary Member

Posts

Joined
Tue Mar 04, 2014 1:37 am
Location - Switzerland

Post by Jelle85 » Fri Jul 21, 2017 3:58 am

Hi Ernie, thank a lot!! Really.

Does this mean if I will go to any other theme in the near future (what probably will happen) this might not work but one of the others will do? You think??

Really really thanks a lot for your time and effort!

Building my second webshop with OC 3.0.2.0
https://shop.taartmonster.nl/


Active Member

Posts

Joined
Thu Dec 20, 2012 7:19 pm

Post by IP_CAM » Fri Jul 21, 2017 6:47 am

this is correct, Custom Themes use their own Theme-related Layout,
and likely their own Stylesheet Content, and even Class-Names.
So, one has to find out first, how something has been done on a Page,
in order to 'place' modifications, to work and match the visual 'Look'.
Good Luck!
Ernie

My Github OC Site: https://github.com/IP-CAM
5'200 + FREE OC Extensions, on the World's largest private Github OC Repository Archive Site.


User avatar
Legendary Member

Posts

Joined
Tue Mar 04, 2014 1:37 am
Location - Switzerland

Post by Jelle85 » Fri Jul 21, 2017 3:41 pm

I found out it is not working as I wished for so maybe this is not what I should do or should want..

But thanks!! A lot

Building my second webshop with OC 3.0.2.0
https://shop.taartmonster.nl/


Active Member

Posts

Joined
Thu Dec 20, 2012 7:19 pm

Post by Jelle85 » Fri Aug 04, 2017 7:49 pm

Hi Ernie,

I am trying to fix my site... I added the pictures and they are fine... BUT... nnow it comes ;)
I can not click the images to go to the products belonging to the brand I click on. I can only click the brand name.

I hope you understand what I am saying... I just dont understand this version... thanks again!

Building my second webshop with OC 3.0.2.0
https://shop.taartmonster.nl/


Active Member

Posts

Joined
Thu Dec 20, 2012 7:19 pm

Post by IP_CAM » Sat Aug 05, 2017 1:22 am

well, if you see this Code, it COVERS the entire Content within a
<a class="list-group-item" href= Routine, and closing this Section after this:
<?php echo $category['name']; ?></a>
and if you used the same Routine, it should add the href-commend to the images as well.
Ernie

Code: Select all

<a class="list-group-item" href="<?php echo $category['href']; ?>">
<?php if($category['image']){ ?>
<img class="img-thumbnail" src="<?php echo $category['image']; ?>" alt="Category" width="160" height="125" /><br>
<?php } ?>
<?php echo $category['name']; ?></a>

My Github OC Site: https://github.com/IP-CAM
5'200 + FREE OC Extensions, on the World's largest private Github OC Repository Archive Site.


User avatar
Legendary Member

Posts

Joined
Tue Mar 04, 2014 1:37 am
Location - Switzerland
Who is online

Users browsing this forum: No registered users and 205 guests