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:
<tr>
<td class="field-name" nowrap>{$lang.show_products}:</td>
<td> </td>
<td>
<select name="category_data[show_products]">
<option value="Y" {if $category_data.show_products == 'Y'}selected="selected"{/if}>{$lang.yes}</option>
<option value="N" {if $category_data.show_products == 'N'}selected="selected"{/if}>{$lang.no}</option>
</select>
</td>
</tr>
---
Step 4. File Modification: (2 of 2)
[skin]/customer/categories_pages/categories.tpl
find this:
{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} <p align="center"><b>{$lang.text_no_products}</b></p> {/if}replace with this this:
{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} <p align="center"><b>{$lang.text_no_products}</b></p> {/if} {/if}