Community Forums

1.5 Subcategory Images

General support for technical problems with OpenCart v1.x

Re: 1.5 Subcategory Images

Postby Goncharenko » Tue Mar 20, 2012 12:19 pm

Is there any way of removing the sub cat image at the top within the sub categories themselves? 1.5.2.1 using custom theme (gentle).
Goncharenko
 
Posts: 13
Joined: Sun Mar 18, 2012 1:21 am

Re: 1.5 Subcategory Images

Postby Jez D » Fri Mar 23, 2012 2:53 am

Web Developer ( & Firefighter)
Web Development, Web Content Management, Mobile Web Design, Android Apps

www.webdesign-plus.co.uk
Jez D
 
Posts: 75
Joined: Mon Nov 14, 2011 9:20 am
Location: United Kingdom

Re: 1.5 Subcategory Images

Postby Goncharenko » Mon Mar 26, 2012 11:21 am



Tested on 1.5.2.1?
Goncharenko
 
Posts: 13
Joined: Sun Mar 18, 2012 1:21 am

Re: 1.5 Subcategory Images

Postby grahamdek » Wed Mar 28, 2012 1:00 pm

When I do a manual install I get this error on the Refine Search results page, it shows the image but also shows the error together.
You can see it at http://www.definitivedesign.co.za/mall/ ... ry&path=65

The error is:

Notice: Undefined index: thumb in /home/definit1/public_html/mall/vqmod/vqcache/vq2-catalog_view_theme_default_template_product_category.tpl on line

I do have Fido-X Store Manager installed which uses a lot of Vqmods, if this is the case, is there a way around it?

Thanks
User avatar
grahamdek
 
Posts: 17
Joined: Thu Mar 08, 2012 12:48 pm
Location: South Africa

Re: 1.5 Subcategory Images

Postby Jez D » Wed Mar 28, 2012 1:13 pm

Manual install? What did you install?
Web Developer ( & Firefighter)
Web Development, Web Content Management, Mobile Web Design, Android Apps

www.webdesign-plus.co.uk
Jez D
 
Posts: 75
Joined: Mon Nov 14, 2011 9:20 am
Location: United Kingdom

Re: 1.5 Subcategory Images

Postby grahamdek » Wed Mar 28, 2012 3:10 pm

Sorry, the instructions are called Installation Manual, so I said install. What I meant was Manual File Update

I used this:

Edit: ../catalog/controller/product/category.php

Find (around line 136):

$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) ); }


REPLACE WITH:

$product_total = $this->model_catalog_product->getTotalProducts($data); $image = $this->model_tool_image->resize($result['image'], 60, 60); $this->data['categories'][] = array( 'name' => $result['name'] . ' (' . $product_total . ')', 'href' => $this->url->link('product/category', 'path=' . $this->request->get['path'] . '_' . $result['category_id'] . $url), 'thumb' => $image ); }


Save and upload.

Edit: ../catalog/view/theme/YOURTHEME/template/product/category.tpl

Find:


<?php if ($categories) { ?> <h2><?php echo $text_refine; ?></h2> <div class="category-list"> <?php if (count($categories) <= 5) { ?> <ul> <?php foreach ($categories as $category) { ?> <li><a href="<?php echo $category['href']; ?>"><?php echo $category['name']; ?></a></li> <?php } ?> </ul> <?php } else { ?> <?php for ($i = 0; $i < count($categories);) { ?> <ul> <?php $j = $i + ceil(count($categories) / 4); ?> <?php for (; $i < $j; $i++) { ?> <?php if (isset($categories[$i])) { ?> <li><a href="<?php echo $categories[$i]['href']; ?>"><?php echo $categories[$i]['name']; ?></a></li> <?php } ?> <?php } ?> </ul> <?php } ?> <?php } ?> </div> <?php } ?>


REPLACE WITH:

<?php if ($categories) { ?> <div class="box"> <div class="box-heading"><?php echo $text_refine; ?></div> <div class="box-content"> <div class="box-product"> <?php foreach ($categories as $category) { ?> <div> <?php if ($category['thumb']) { ?> <div class="image" style="text-align: center"> <a href="<?php echo $category['href']; ?>"><img src="<?php echo $category['thumb']; ?>" alt="<?php echo $category['name']; ?>" /></a> </div> <?php } ?> <div style="text-align: center"><a href="<?php echo $category['href']; ?>"><?php echo $category['name']; ?></a></div></div> <?php } ?> </div> </div> </div> <?php } ?>


Save the file and upload.
User avatar
grahamdek
 
Posts: 17
Joined: Thu Mar 08, 2012 12:48 pm
Location: South Africa

Re: 1.5 Subcategory Images

Postby grgr » Thu Mar 29, 2012 8:24 am

Sounds like there might be a vQmod within the store manager extension that is altering this file. See if you can find it and you might then need to integrate the above code into the vQmod.
Image Image Image Image Image Image
User avatar
grgr
 
Posts: 834
Joined: Mon Mar 28, 2011 8:08 am

Re: 1.5 Subcategory Images

Postby Jez D » Thu Mar 29, 2012 12:28 pm

Goncharenko wrote:


Tested on 1.5.2.1?


Not yet
Web Developer ( & Firefighter)
Web Development, Web Content Management, Mobile Web Design, Android Apps

www.webdesign-plus.co.uk
Jez D
 
Posts: 75
Joined: Mon Nov 14, 2011 9:20 am
Location: United Kingdom

Re: 1.5 Subcategory Images

Postby Baco » Thu Apr 19, 2012 9:28 pm

How to paginate in parrent category ?
p.s. Have a 30-50 subcategories whith images, add
Code: Select all
<div class="pagination"><?php echo $pagination; ?></div>

text pages is displayed, but not paginated (in sys./libr./pagination.php wrote public $limit = 15;)
any ideas or this is bug ?
Baco
 
Posts: 3
Joined: Thu Apr 19, 2012 9:22 pm

Re: 1.5 Subcategory Images

Postby jimmyharwood » Sat Apr 28, 2012 3:43 pm

I have recently updated to 1.5.3.1 and the sub cat xml has stopped working, strangely I have had a couple of xml stop working while others carry on quite merry, I have made some css changes to my site, but every thing is still in default.
I have cleared the vqmod cache, but no changes - any ideas? :)

Jimmy
jimmyharwood
 
Posts: 41
Joined: Wed Dec 28, 2011 4:55 pm

Re: 1.5 Subcategory Images

Postby jimmyharwood » Sat Apr 28, 2012 10:00 pm

I have resolved this, i ran the vqmod install again, problem sorted
jimmyharwood
 
Posts: 41
Joined: Wed Dec 28, 2011 4:55 pm

Re: 1.5 Subcategory Images

Postby DannyMacD » Fri Jun 15, 2012 5:57 pm

wow... 9 pages later...

is there a VQmod solution for 1.5.3.1?
DannyMacD
 
Posts: 471
Joined: Thu Jun 25, 2009 10:39 pm

Re: 1.5 Subcategory Images

Postby Jez D » Wed Jul 04, 2012 5:01 pm

Goncharenko wrote:


Tested on 1.5.2.1?


Yes
Web Developer ( & Firefighter)
Web Development, Web Content Management, Mobile Web Design, Android Apps

www.webdesign-plus.co.uk
Jez D
 
Posts: 75
Joined: Mon Nov 14, 2011 9:20 am
Location: United Kingdom

Re: 1.5 Subcategory Images

Postby bojanglebeads » Thu Jul 19, 2012 10:39 am

Hi there, I', trying to use this mod on the Sellegance theme, but when it's enabled I get the following message underneath the category images:

Notice: Undefined variable: j in /home/*mysite*/public_html/opencart/vqmod/vqcache/vq2-catalog_view_theme_sellegance_template_product_category.tpl on line 90Notice: Undefined variable: i in /home/*mysite*/public_html/opencart/vqmod/vqcache/vq2-catalog_view_theme_sellegance_template_product_category.tpl on line 90

I've tried to attach the sellegance category.tpl file that contains the variables this error refers to (but it was rejected so I can post separately if anyone has any ideas!). Any help would be greatly appreciated as Sellegance doesn't seem to allow for category images in its skinning options!

Steve
bojanglebeads
 
Posts: 2
Joined: Thu Jul 19, 2012 10:29 am

Re: 1.5 Subcategory Images

Postby ThuNderGr » Thu Nov 22, 2012 7:57 am

Does this mod work on 1.5.4.1?
Εστιατορια Αθηνα http://www.athensmenu.gr
ThuNderGr
 
Posts: 7
Joined: Fri Feb 03, 2012 9:08 am

Re: 1.5 Subcategory Images

Postby andrejuseu » Mon Feb 18, 2013 8:41 pm

ThuNderGr wrote:Does this mod work on 1.5.4.1?

Yes, just use viewtopic.php?f=20&t=34923&start=160#p268278 guide
Lithuanian Opencart Support Member
Lithuanian support @ OCLietuva.com
User avatar
andrejuseu
 
Posts: 21
Joined: Fri Dec 23, 2011 11:36 am

Re: 1.5 Subcategory Images

Postby ivanatap » Mon May 27, 2013 1:06 pm

Hi all,

I have a problem with subcategory images and I hope that someone could help me. I use OC version 1.5.4.1 and I upload subcat_image.xml (you can see code bellow) file through vQmod, bat this module doesn't work properly because it doesn't show images. I view the source code of tha page and src of img tag is actualy empty. I think that $category['thumb'] doesn't work properly.

subcat_image.xml:

Code: Select all
<modification>
   <id>Subcategory Images</id>
   <version>1.0</version>
   <vqmver>1.2.3</vqmver>
   <author>vger.co.uk</author>
   
   <file name="catalog/controller/product/category.php">
        <operation>
            <search position="replace" index="1" offset="6"><![CDATA[
$product_total = $this->model_catalog_product->getTotalProducts($data);
            ]]></search>
            <add><![CDATA[
   $product_total = $this->model_catalog_product->getTotalProducts($data);
   $image = $this->model_tool_image->resize($result['image'], 60, 60);
      
   $this->data['categories'][] = array(
      'name'  => $result['name'] . ' (' . $product_total . ')',
      'href'  => $this->url->link('product/category', 'path=' . $this->request->get['path'] . '_' . $result['category_id'] . $url),
      'thumb' => $image
   );
}
            ]]></add>
        </operation>
   </file>
   
   <file name="catalog/view/theme/*/template/product/category.tpl">
        <operation>
            <search position="replace" index="1" 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">
<?php foreach ($categories as $category) { ?>
<div>
<?php if ($category['thumb']) { ?>
<div class="image" style="text-align: center">
<a href="<?php echo $category['href']; ?>"><img src="<?php echo $category['thumb']; ?>" alt="<?php echo $category['name']; ?>" /></a>
</div>
<?php } ?>
<div style="text-align: center"><a href="<?php echo $category['href']; ?>"><?php echo $category['name']; ?></a></div></div>
<?php } ?>
</div>
</div>
</div>
<?php } ?>
            ]]></add>
        </operation>
   </file>
   
</modification>


Does anyone know what is the problem?

Thanks,
I
ivanatap
 
Posts: 1
Joined: Mon May 27, 2013 12:55 pm

Previous

Return to General Support

Who is online

Users browsing this forum: Alexa [Bot], Artware, barrycorrigan, Chris_AXA, crunchor, Google [Bot], k17, MSN [Bot], MWB-02, papteam, pedro1993, soj47, tcamilo, TheLizard, TriumphDesign, tscarsi, yinako and 115 guests

Hosted by Arvixe Web Hosting