VirtueMart Forum

VirtueMart Dev/Coding Central: VM1 (old version) => Development Projects, Modifications, Hacks & Tweaks. VM1.1 => Topic started by: sudwebdesign on January 15, 2011, 17:07:18 pm

Title: HACK: Random Products Module (change to multiple products)
Post by: sudwebdesign on January 15, 2011, 17:07:18 pm
The standard module will only allow you to specify one Category from which it selects a list of Products.

This is a really simple hack to change the SQL to allow a comma separated list in the category ID field.

Change lines as follows:
33:  $category_id = $params->get( 'category_id', 2 ); // Display products from these categories only
51:    $q .= "AND #__{vm}_category.category_id in ($category_id)";

or see attached file which should replace the installed file in your-site/modules/mod_virtuemart_randomprod
NOTE: remove the ".txt" from the end of the file name

[attachment cleanup by admin]
Title: Re: HACK: Random Products Module (change to multiple products)
Post by: hoze on March 31, 2011, 14:27:45 pm
Thx. Work great!
Title: Re: HACK: Random Products Module (change to multiple products)
Post by: Dieda12 on October 31, 2011, 15:29:12 pm
Thanks a lot, really useful hack !
Title: Re: HACK: Random Products Module (change to multiple products)
Post by: rupesh on May 15, 2012, 15:40:15 pm
hiii
Can you do same for virtuemart 2.0?
Thank you
Rupesh
Title: Re: HACK: Random Products Module (change to multiple products)
Post by: lipes on April 23, 2013, 21:16:02 pm
did someone discover how to add that in virtuemart 2 ?