Author Topic: HACK: Random Products Module (change to multiple products)  (Read 6166 times)

sudwebdesign

  • Beginner
  • *
  • Posts: 4
HACK: Random Products Module (change to multiple products)
« 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]

hoze

  • Beginner
  • *
  • Posts: 5
    • Telefoni Online
Re: HACK: Random Products Module (change to multiple products)
« Reply #1 on: March 31, 2011, 14:27:45 pm »
Thx. Work great!

Dieda12

  • Beginner
  • *
  • Posts: 5
Re: HACK: Random Products Module (change to multiple products)
« Reply #2 on: October 31, 2011, 15:29:12 pm »
Thanks a lot, really useful hack !

rupesh

  • Jr. Member
  • **
  • Posts: 113
Re: HACK: Random Products Module (change to multiple products)
« Reply #3 on: May 15, 2012, 15:40:15 pm »
hiii
Can you do same for virtuemart 2.0?
Thank you
Rupesh

lipes

  • Full Member
  • ***
  • Posts: 720
Re: HACK: Random Products Module (change to multiple products)
« Reply #4 on: April 23, 2013, 21:16:02 pm »
did someone discover how to add that in virtuemart 2 ?
VM V. online: J2.5.14 | VM 2.0.20a | SQL 5.1.70 | PHP 5.3.25