Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls

Mod for Featured Products 'module'

   X-Cart forums > X-Cart 4 > Dev Questions
Thread Tools Search this Thread
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

- 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:

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:

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

With this:

{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,
X-Cart 4.0.17
PHP 4.4.1
MySQL 4.0.25-standard
Apache 1.3.34
Reply With Quote
Old 06-15-2005, 05:09 PM
  groovico's Avatar 
groovico groovico is offline

Join Date: Apr 2003
Posts: 2,326


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

Used by X-carters the world over:
Marketing Manager Pro Bundle For X-cart
Featured Product Manager for X-cart
Feed manager pro for X-cart

Celebrating 7 Years of providing quality X-cart Add ons and X-cart Mods for x-cart 3.X to X-cart 4.4.X
Reply With Quote
   X-Cart forums > X-Cart 4 > Dev Questions

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

All times are GMT -8. The time now is 08:48 PM.


X-Cart forums © 2001-2020