ADDON: Subcategory Thumbnails

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!



    Make sure you add images to your subcategory thumbnail section. Probably be wise to make sure all the thumbnails are the same size.



    Change /skins/YOUR_SKIN/customer/addons/subcat_thumbs/hooks/categories/view.override.tpl to suit your needs.



    N.B. Make sure any changes are mirrored in /var/skins_repository/base/customer/addons/subcat_thumbs/hooks/categories/view.override.tpl, as the file gets installed from there, so if you uninstall and then reinstall you’ll lose all your changes.



    enjoy.



    Normal Version:





    Thumbnail Version:

    subcat_thumbs.zip

Thanks for this, Charlie. It’s nice that you used the “hook” implementation. I think this is going to open CS-Cart for many other possibilities.



Bob

I agree, hooks will definately make upgrades much much easier.

Dude thanks! I was ready to beg someone to do this for v2. The only thing left for me to port from v1 is watermarking my product image pop-ups (http://forum.cs-cart.com/showthread.php?t=2553&highlight=watermark).



I tried (copying the 3 files to the image directory) but I think the watermark .htaccess file causes a conflict with the root .htaccess that blocks/prevents the pop-up.



If you can get this working I owe you big time!

After the happiness wore off I realized this addon removes category descriptions. I uninstall the addon and description returns.



How do I have both the category description and thumbnails?



Disregard - I figured it out.



Replaced the first several lines of code in /customer/addons/subcat_thumbs/hooks/categories/view.override.tpl


{* $Id: view.tpl *}

{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:"2"}
{split data=$subcategories size=$rows assign="splitted_subcategories"}

Yeah sorry i removed the description as i wasn’t using it.

Displaying a subcategories list as a multicolumn list with images by cs-cart:

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

Can someone make a mod o switch between list and grid view in category ?

This seems like a nice add-on, thanks for this baballuci.



Can I ask what folders they are uplodaed to in a bit more detail as I’m having one of those thick days and cannot get it to work.



Oh and this is for 2.0.4

Great mod Charlie. Thank you for that.



How can I have the description under the picture, not above?

[quote name=‘Noman’]Great mod Charlie. Thank you for that.



How can I have the description under the picture, not above?[/QUOTE]

Do you mean the link?



If so, then open /skins/YOURSKIN/customer/addons/subcat_thumbs/hooks/categories/view.override.tpl and delete the following (around line 24):

{$category.category}





and paste the following:



{$category.category}



after:

{if empty($category_image.icon.image_path)}
{$category_image.icon.alt}
{else}
{$category_image.icon.alt}
{/if}




Bob

Bob - you must be handsome :wink: Thank you sir!

Bob i need one help. When i add description on the categories pages they not appering on the product page, is there any option to enable ?

[quote name=‘miracles’]Bob i need one help. When i add description on the categories pages they not appering on the product page, is there any option to enable ?[/QUOTE]

No option that I know of - you would need to code this.



Bob

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

Thanks mate :slight_smile:

This is a perfect example of why hooks can be dangerous with an upgrade. This hook overwrote some new functionality that 2.07 added. It took me a a while to figure out it was this hook that was causing the new product change view feature of 2.07 to not function.



Anyway for 2.07 in this hook’s addon change


{if $products}
{if $settings.Appearance.columns_in_products_list > 1}
{include file="views/products/components/products_multicolumns.tpl" columns=$settings.Appearance.columns_in_products_list}
{else}
{include file="views/products/components/products.tpl" title=""}
{/if}




to


{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}




I would highly recommend with each upgrade one disable their custom hooks and slowly add them in one at a time to make sure they do not overwrite any new functionality.

I’ve taken the liberty of adding all the changes to a new zip



jobosales - subcategories description under pic

Dave the Slave - Category descriptions

Mine - Subcategories image clickable

Triplets - 2.0.7 views fix



Working on 2.0.7

subcat_thumbs_20090830.zip

This is totally a newbie question but how do you upload the files to your site? I am using Dreamweaver FTP.

I gave up on DW as an FTP tool - been happily using WinSCP for a year now. Changing file permissions has never been so fun.



[url]http://winscp.net/eng/index.php[/url]



Get this and Putty and you will be in SFTP/SSH heaven!