Don't display empty categories.

Where or how can i set up cs-cart only categories with products to display and categories without to hide?

Hello karrde,



Some code modifications are required to implement this feature. We would be happy to assist you in this matter within our technical support service. Please contact us via Customer Help Desk if you have support credits or an active support period.





Anastasiya Kozlova

CS-Cart Support Team

I already made a post with this addon, but I can't seem to find it.



Just install this addon and in one of the menus there is a Compress Categories option. Just click that and it will hide any empty categories.



Hope that helps,



Brandon

Hide Categories v2.zip

I actually tried to use this addon, but it only hid my first level empty categories. It did not go through my second level ones (which has the most empty categories).



Did I run the addon incorrectly?

Won't hide categories (and their result pages) have a negative impact on SEO if search engines have seen these pages already? Not to mention that external links to them will get broken and eventually lost.



On the other hand, empty category result pages have all the same content “keep walking, nothing to look at here folks” - so there could be a rank penalty for duplicate content as well.



I'd be interested in knowing if anyone had any insight on best practice and results of hiding empty categories, at least from a SEO stand.



From the visitors point of view, it makes for a cleaner look and more productive visit, specially on a site with many categories and not enough products.

Well this is a good subject.



I too would like to save my customers time by hiding empty categories but as said already it create SEO problems and also perhaps the category is only short term empty ? visitor comes and sees you don't stock those items doesn't come back, we don't want that.



Also the duplicate content issue ? I don't see it being an issue but who now what Google do in their wisdom - I hate it that everyone seems to give Google works 100%, I would be suprised if 50% of what is said they do actuly does what any of us assumes it does.



I think perhaps the answer is an marker on the empty categories or if it uses the same resource just the count of products in the category is good enough.

I think I have decided what I want to do with empty categories.



All categories shown by default but when members login all empty categories are hidden.



Also I would like to hide the price of “out of stock”



Any ideas on achieving the above ?

[size=3][font=verdana, geneva, sans-serif]G'day Kickoff3pm,[/font][/size]



Empty Categories

[size=3][font=verdana, geneva, sans-serif]Check out several of the modifications, hacks and add-ons in the forums.[/font][/size]



[size=3][font=verdana, geneva, sans-serif]Hide Price for 0 Stock[/font]

Hiding price if out of stock [color=#0000cd](if $product_qty lt 1 -or- $product_qty eq 0)[/color][font=tahoma, geneva, sans-serif] [/font][font=verdana, geneva, sans-serif]is much easier. You could even place an AND or OR between by using [/font][font=verdana, geneva, sans-serif]&& or || . See below.[/font][/size]





[size=3][font=verdana, geneva, sans-serif]For products there are various “templates” available. By modifying the active template all your products will be updated. See “Settings → Appearance → Product detailed page layout” located in: …/skins/____/customer/blocks/product_templates/



Make a backup first and then modify either: /default_template.tpl or /default_long_options_template.tpl



The same applies to category product listing. Depending which of the 3 choices you use (default: Product Grid) and which views you have available to choose from will depend how many files you need to update. I think these are located somewhere around …/skins//customer/blocks/product_list_templates/



Edit the Product Detail and the Category Product Listing TPL's: (displayed in order)

ULTIMATE: [u]…/stores/
/skins/
/customer/views/[color=#0000FF]products[/color]/[/u]

PRO: …/skins/___/customer/views/[color=#0000FF]products[/color]/



ULTIMATE: …/stores//skins/__/customer/blocks/[color=#0000FF]product_list_templates[/color]/

PRO: …/skins/___/customer/blocks/[color=#0000FF]product_list_templates[/color]/[/font][/size]

[indent=1]

[size=3][font=verdana, geneva, sans-serif]view.tpl[/font][/size][/indent]

[indent=1][quote]{include file=$product.product_id|fn_get_product_details_layout product=$product show_sku=true show_rating=true [color=#ff8c00]show_old_price=true[/color][color=#ff0000] show_price=true[/color][color=#ff0000] [/color]show_list_discount=true show_clean_price=true details_page=true show_discount_label=true show_product_amount=true show_product_options=true hide_form=$smarty.capture.val_hide_form min_qty=true show_edp=true show_add_to_cart=true show_list_buttons=true but_role=“action” capture_buttons=$smarty.capture.val_capture_buttons capture_options_vs_qty=$smarty.capture.val_capture_options_vs_qty separate_buttons=$smarty.capture.val_separate_buttons show_add_to_cart=true show_list_buttons=true but_role=“action” block_width=true no_ajax=$smarty.capture.val_no_ajax show_product_tabs=true}[/quote][/indent]



[indent=1][size=3][font=verdana, geneva, sans-serif]quick_view.tpl[/font][/size][/indent]

[indent=1][quote]{include file=“views/products/components/quick_view_template.tpl” product=$product show_sku=true show_rating=true [color=#ff8c00]show_old_price=true[/color][color=#ff0000] show_price=true[/color] show_list_discount=true show_clean_price=true details_page=true show_discount_label=false show_product_amount=true show_product_options=true hide_form=$smarty.capture.val_hide_form min_qty=true show_edp=true show_add_to_cart=true show_list_buttons=true but_role=“action” capture_buttons=$smarty.capture.val_capture_buttons capture_options_vs_qty=$smarty.capture.val_capture_options_vs_qty separate_buttons=false show_list_buttons=false but_role=“action” block_width=true no_ajax=$smarty.capture.val_no_ajax show_descr=true quick_view=true}[/quote][/indent]

[indent=1]

[size=3][font=verdana, geneva, sans-serif]search.tpl[/font][/size][/indent]

[indent=1][size=3][font=verdana, geneva, sans-serif]You will no doubt have to change the columns available in each of the views available / enabled for Product Grid / List / etc…[/font][/size][/indent]

[indent=1][size=3][font=verdana, geneva, sans-serif]…/components/[/font][/size][/indent]

[indent=1][size=3][font=verdana, geneva, sans-serif]Keep having a look around and you can easily turn various content ON and OFF by changing them from true to false and vice-versa.[/font][/size][/indent]



[size=3][font=tahoma, geneva, sans-serif][font=verdana, geneva, sans-serif]You will need to do a simple [/font][font=courier new,courier,monospace][color=#0000CD]{if $product_qty lt “1”}[/color][/font] Sorry! Out of Stock [font=courier new,courier,monospace][color=#0000CD]{else}[/color][/font] In Stock: [/font][/size][font=courier new,courier,monospace][color=#0000CD][size=3]{$product_qty}[/size][/color][/font][size=3][font=tahoma, geneva, sans-serif] [font=courier new,courier,monospace][color=#0000CD]{/if}[/color][/font] [font=tahoma, geneva, sans-serif][font=verdana, geneva, sans-serif]- or use [/font][font=courier new,courier,monospace][color=#0000CD]{elseif $xxx eq “0”}[/color][/font] [font=verdana, geneva, sans-serif]if you want multiple “IF's”.[/font][/font]

[font=verdana, geneva, sans-serif](Note: Obviously using the Smarty variables already available in the files or by placing [color=#0000cd]{debug}[/color] in the file, saving, refreshing in browser to display the debug window which lists all variables for that page or section of the page).[/font][/font]



[font=verdana, geneva, sans-serif]I hope this was helpful and good luck![/font][/size]

Wonderful, I make sure I take a look at that when have time.



I've had to put back the new site till I get some other work done, might be next year now.



Thanks a lot, I'll keep you in mind.

Still work this addon ? on 4.2... ?

look very old posts