X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Dev Questions (https://forum.x-cart.com/forumdisplay.php?f=20)
-   -   Mod for Featured Products 'module' (https://forum.x-cart.com/showthread.php?t=14592)

jb5ep 06-15-2005 11:21 AM

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

groovico 06-15-2005 05:09 PM

Thats a nice simple way of being able to switch on and off other parts, Nicely done!


All times are GMT -8. The time now is 04:25 PM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.