View Single Post
  #1  
Old 06-15-2005, 11:21 AM
 
jb5ep jb5ep is offline
 

Advanced Member
  
Join Date: Apr 2005
Location: U.K.
Posts: 65
 

Default Mod for Featured Products 'module'

One of my clients wanted to be able to enable/disable the 'Featured Products' box (we have it on the homepage), without commenting out code in tpl's. Thought i'd share what i've done with other XC folk. So...

Here's a simple mod to allow you to control the 'Featured Products' dialog from the modules page in admin

Notes:
- BACKUP all files and take a dump of your xcart_modules data before changing anything just to be safe...
- I haven't tested this too much
- This isn't strictly a module, - it just uses the 'module' page in admin

Step 1:

Run this query:

Code:
INSERT INTO `xcart_modules` ( `moduleid` , `module_name` , `module_descr` , `active` ) VALUES ( '100', 'Featured_Products', 'Enable/Disable Featured Products dialog', 'Y' );


I don't know if there's any logic to the 'moduleid' - i've just used the value '100' as this isn't currently being used...

Step 2:

Wherever you have the featured products dialog appearing (we have it being called from customer/main/welcome.tpl), replace this:

Code:
{include file="customer/main/featured.tpl" f_products=$f_products}

With this:

Code:
{if $active_modules.Featured_Products ne ""} {include file="customer/main/featured.tpl" f_products=$f_products} {/if}

Step 3:
- Log into your admin and goto 'modules'
- You should have a new 'module' called 'Featured Products'
- If you don't want it, switch it off!

Comments welcome,
Cheers
__________________
X-Cart 4.0.17
ezUpsell
PHP 4.4.1
MySQL 4.0.25-standard
Apache 1.3.34
Linux
Reply With Quote