1.35sp3 Mod: How to turn off category products from showing.

Total Steps: 4

Degree of Difficulty: easy to moderate

Files to be modified: 2



In order to use a “custom” landing page for categories, some of the default functionality would need to be disabled, such as the displaying of products.



Creating a custom landing page can be as easy as adding the appropriate html code to the Full Description of any category.



Here’s the method I used to create “Show Products?” option for each category.

Note: this method can be used to apply other settings to categories.



Step 1. Create a language variable: show_products





Step 2. Create a new field in the cscart database table: cscart_categories with the following parameters


  1. Field show_products
  2. Type: CHAR
  3. Default: Y





    Step 3. File Modification: (1 of 2):

    [skin]/admin/categories_pages/categories_update.tpl

    (I’m using default blue for this example)



    find this:


{if $settings.Addons.discussion == "Y"}
{include file="addons/discussion/allow_discussion.tpl" object_id=$category_data.category_id object_type="C" title=$lang.discussion_title_category}
{/if}




add this after the above code:



[HTML]

{$lang.show_products}:







[/HTML]

---
Step 4. File Modification: (2 of 2)
[skin]/customer/categories_pages/categories.tpl

find this:
```php
{if $products}
{if $settings.Appearance.columns_in_products_list > 1}
{include file="products_pages/products_multicolumns.tpl" columns=$settings.Appearance.columns_in_products_list}
{elseif $settings.Appearance.advanced_products_list == 'Y' && $client_env.is_javascript == 'Y'}
{include file="products_pages/products_advanced.tpl" title=""}
{else}
{include file="products_pages/products.tpl" title=""}
{/if}

{elseif !$subcategories}

{$lang.text_no_products}


{/if}
```
replace with this this:

```php
{if $category_data.show_products == "Y"}
{if $products}
{if $settings.Appearance.columns_in_products_list > 1}
{include file="products_pages/products_multicolumns.tpl" columns=$settings.Appearance.columns_in_products_list}
{elseif $settings.Appearance.advanced_products_list == 'Y' && $client_env.is_javascript == 'Y'}
{include file="products_pages/products_advanced.tpl" title=""}
{else}
{include file="products_pages/products.tpl" title=""}
{/if}

{elseif !$subcategories}

{$lang.text_no_products}


{/if}
{/if}
```

Do you have an example of what you are doing here? I’m not for sure I understand.

I don’t really understand either. It sounds like you’re making it so that categories don’t show products.

Sorry about that guys :slight_smile:



My site is still under development, but let’s see if I can clarify it a little further.



The default behavior of any category’s landing page is to show it’s products below the full description.



Look at this website for example when you click on the diamonds category:

[url]mondera.com



Diamonds having loose diamonds as the primary category’s product also has MANY subcategories (diamonds pendants, diamond earrings, engagement rings)



Because there’s no point in showing a visitor all loose diamonds when more than likely they are interested in a very select group of them, turning off default product showing for this category is required.



The diamonds category is pretty much used as a place holder for within the category system. Displaying diamonds as products on this category’s page would defeat the purpose of the website visitor’s purchasing path that the company chooses (custom subcategory layout, predefined search results, etc…)



And setting up an option with Yes or No (default Yes) to show products maintains the original functionality of the CS-cart category system that will still be used by other categories not needing a custom layout.



Simple insert the custom landing page html in the Full Description and voila…



This option serves its purpose for now… However ideally what I’m going to code once our skin is done is a custom landing page admin addon for categories instead of using the built in behavior…



custom product details pages addon idea (I like brainstorming)

Each category can have it’s own product details page that will be applied to all products in the category, otherwise use product, otherwise use default

Each product can have it’s own product details page, otherwise use category, otherwise use default.

Have you got a workaround for V2?


[quote name=‘rcaubin’]Sorry about that guys :slight_smile:



My site is still under development, but let’s see if I can clarify it a little further.



The default behavior of any category’s landing page is to show it’s products below the full description.



Look at this website for example when you click on the diamonds category:

[url]mondera.com



Diamonds having loose diamonds as the primary category’s product also has MANY subcategories (diamonds pendants, diamond earrings, engagement rings)



Because there’s no point in showing a visitor all loose diamonds when more than likely they are interested in a very select group of them, turning off default product showing for this category is required.



The diamonds category is pretty much used as a place holder for within the category system. Displaying diamonds as products on this category’s page would defeat the purpose of the website visitor’s purchasing path that the company chooses (custom subcategory layout, predefined search results, etc…)



And setting up an option with Yes or No (default Yes) to show products maintains the original functionality of the CS-cart category system that will still be used by other categories not needing a custom layout.



Simple insert the custom landing page html in the Full Description and voila…



This option serves its purpose for now… However ideally what I’m going to code once our skin is done is a custom landing page admin addon for categories instead of using the built in behavior…



custom product details pages addon idea (I like brainstorming)

Each category can have it’s own product details page that will be applied to all products in the category, otherwise use product, otherwise use default

Each product can have it’s own product details page, otherwise use category, otherwise use default.[/QUOTE]