ADDON: Subcategory Thumbnails

I am still having difficulty displaying the sub category image on the parent category page.



Each sub category here (with the exception of one) has a thumbnail.



[URL]http://www.tickledgreenbaby.ca/index.php?dispatch=categories.view&category_id=5[/URL]



Yet, no image displays.



In /skins/[SKIN NAME]/customer/views/categories/view.tpl, the code is:


```php

{* $Id: view.tpl 7763 2009-07-29 13:19:43Z alexions $ *}



{hook name=“categories:view”}

{if $subcategories or $category_data.description || $category_data.main_pair}

{math equation=“ceil(n/c)” assign=“rows” n=$subcategories|count c=$columns|default:“1”}

{split data=$subcategories size=$rows assign=“splitted_subcategories”}



{if $category_data.description && $category_data.description != “”}

{$category_data.description|unescape}


{/if}






{if $category_data.main_pair}

{if $category_data.main_pair.detailed_id}
{include file="common_templates/previewer.tpl"}
{/if}

{/if}

{if $subcategories}
{foreach from=$splitted_subcategories item="scats"}
{foreach from=$scats item=category}
{if $category}

{/if}
{/foreach}
{/foreach}
{/if}

{/if}

{if $smarty.request.advanced_filter}
{include file="views/products/components/product_filters_advanced_form.tpl" separate_form=true}
{/if}

{if $products}
{assign var="layouts" value=""|fn_get_products_views:false:0}
{if $category_data.product_columns}
{assign var="product_columns" value=$category_data.product_columns}
{else}
{assign var="product_columns" value=$settings.Appearance.columns_in_products_list}
{/if}

{if $layouts.$selected_layout.template}
{include file="`$layouts.$selected_layout.template`" columns=`$product_columns`}
{/if}

{elseif !$subcategories}

{$lang.text_no_products}


{/if}

{capture name="mainbox_title"}{$category_data.category}{/capture}
{/hook}
```

I am still experiencing an issue with the secondary categories not displaying. The altered code is listed in my earlier post. Your help is appreciated!

[quote name=‘seven24’]I am still experiencing an issue with the secondary categories not displaying. The altered code is listed in my earlier post. Your help is appreciated![/QUOTE]



Finally figured this out. Thank goodness!

What did you do?

Review all of the steps here:

[url]CS-Cart Documentation — CS-Cart 4.15.x documentation

[quote name=‘baballuci’]A few people have asked for this, it’s a port from the 1.3.5 version here, but as an addon. Screenshots are shown below.



Installation:

  1. Download and unpack attached zip file. ( use Firefox not IE )
  2. Upload both folders to site
  3. Log into Admin, goto addons, scroll down to “Subcategory Thumbnails” and click install.
  4. That’s it!

    [/QUOTE]



    For some reason I’m not seeing the addon in the admin after I’ve uploaded it via FTP. Any ideas why this would happen?



    Thanks!

[quote name=‘seven24’]Review all of the steps here:

[URL]CS-Cart Documentation — CS-Cart 4.15.x documentation



I performed this EXACTLY and it makes a mess. All of our images are very large detailed images that allow the user to zoom in and get a good look at the stuff in the larger image view. Since the thumbnails are normally “auto-generated” this is not a problem. With this modification, it seems that the “auto-generation” of smaller images goes away and the large images are displayed which makes a crazy mess on the screen… any ideas (other than going back in and manually resizing / re-uploading all category and subcategory images that is…



Thanks in advance.

Thanks for the help.

Got this up and running so far. The only problem is that my images are really tiny. Is there a way to enlarge these?

[quote name=‘seven24’]Review all of the steps here:

[url]CS-Cart Documentation — CS-Cart 4.15.x documentation



Anyone else not getting this to work in 2.1.2?



I only get ‘no image’ instead of the subcategory thumb (which does show when on the actual sub cat page).

Brandon’s addon works for 2.1.2

[url]http://forum.cs-cart.com/showthread.php?t=20545[/url]

I just did this and it’s working great in 2.1.3



[url]CS-Cart Documentation — CS-Cart 4.15.x documentation

Hi there,



I am using the mod above and it works fine… the only thing that is annoying is the following.



When somebody goes to a category, and then filters by feature (ie. brand), the subcategory images still show up. I’d like them to go away, so people get a list of all the products by a certain brand in a certain category.



Would be great if somebody can tell me how to to this!



Thanks,



Floris

I agree with Flow, that would be a great feature in the addon too.

You can check out [url]http://forum.cs-cart.com/showthread.php?t=23127[/url]



You should be able to get that to work with your subcategories.



I don’t remember the solution on this thread, but the categories filter addon works with the [url]http://forum.cs-cart.com/showthread.php?t=20545[/url]



I use the category filter addon and the subcategories with images addon together and it works great.



The default way CS has it is super annoying.



Hope it helps,



Brandon

[quote name=‘baballuci’]Add:


{if $category_data.description && $category_data.description != ""}

{$category_data.description|unescape}

{/if}




below:


{if $subcategories or $category_data.description || $category_data.main_pair}




in …/customer/addons/subcat_thumbs/hooks/categories/view.override.tpl[/QUOTE]



Hello,

How can i make this:

[url]https://lh5.googleusercontent.com/_McWLuvaRgVo/TaBbI_jtVhI/AAAAAAAAAIM/fjbvV4jTY8M/SubCategoryDescription.jpg[/url]



This is my code:



```php {if $subcategories or $category_data.description || $category_data.main_pair}

{split data=$subcategories size=$columns|default:“1” assign=“splitted_subcategories”}

{math equation=“floor(100/x)” x=$columns|default:“1” assign=“cell_width”}

{if $category_data.description && $category_data.description != “”}

{$category_data.description|unescape}

{/if}

{if $category_data.main_pair}

{include file="common_templates/image.tpl" show_detailed_link=true images=$category_data.main_pair object_type="detailed_category" no_ids=true class="cm-thumbnails" show_thumbnail="Y" image_width=$settings.Thumbnails.category_details_thumbnail_width image_height=$settings.Thumbnails.category_details_thumbnail_height}


{if $category_data.main_pair.detailed_id}
{include file="common_templates/previewer.tpl"}
{/if}

{/if}


{foreach from=$splitted_subcategories item="scats"}

{foreach from=$scats item="category"}
{if $category}

{else}
{/if}
{/foreach}



{foreach from=$scats item="category"}
{if $category}

{else}
{/if}
{/foreach}




INSERT DESCRIPTION SUBCATEGORY









{/foreach}

{/if}
{if $smarty.request.advanced_filter}
{include file="views/products/components/product_filters_advanced_form.tpl" separate_form=true}
{/if}
{if $products}
{assign var="layouts" value=""|fn_get_products_views:false:0}
{if $category_data.product_columns}
{assign var="product_columns" value=$category_data.product_columns}
{else}
{assign var="product_columns" value=$settings.Appearance.columns_in_products_list}
{/if}

{if $layouts.$selected_layout.template}
{include file="`$layouts.$selected_layout.template`" columns=`$product_columns`}
{/if}

{elseif !$subcategories}

{$lang.text_no_products}


{/if}
{capture name="mainbox_title"}{$category_data.category}{/capture} ```

Anyone can help me?

I followed these instructions here CS-Cart Documentation — CS-Cart 4.15.x documentation and have thumbnail images in my categories but images dont show, anyone else have this ?

www.gsbhealthandsafetysigns.co.uk[attachment=4488:safety.JPG]

Thanks

john

safety.JPG

[quote name='johnbol1' timestamp='1314618224' post='120552']

I followed these instructions here CS-Cart Documentation — CS-Cart 4.15.x documentation and have thumbnail images in my categories but images dont show, anyone else have this ?

www.gsbhealthandsafetysigns.co.uk[attachment=4488:safety.JPG]

Thanks

john

[/quote]

What version are you in?

So far I had it working on 2.2.1CE and 2.2.2CE. Just be careful with the paths as explained in the instructions.



your-site-root/addons/my_changes/controllers/customer/categories.post.php

your-site-root/skins/your-skin/customer/addons/my_changes/hooks/categories/view.override.tpl