Random products by category

ojp3d08

Avatar: ojp3d08

2008-09-15 15:32

Hi, I need random products shows only products from 4 specific categories and not all registered products... How may I do this?

» Quick.Cart v3.x

Pedro Augusto

beholder

Avatar: beholder

2008-09-16 08:18

First of all, you must make sure that the products in those 4 categories (pages actually) have IDs only up to a certain number, 300 for example. No other product from other categories may have lower number (only higher). How you accomplish this is not my problem, it is surely possible by manually tweaking the databases (you need to do this only once on an existing db, and also, every new product will have an ID higher than the highest ID in the product array).

Then you must edit the random product plugin and instead of
$iCount = count( $aRandom );

have this:
$iCount = 300; // the max ID of random products

ojp3d08

Avatar: ojp3d08

2008-09-16 15:22

Hi beholder, it worked well. But is there way to create rules like, lower than 10 and higher than 80?

Because my web site is on air and I use related plugin, cross sell and others like these. If I change their IDs it will cause a great head pain... Do you know how do this?

Thank you!

Pedro Augusto

beholder

Avatar: beholder

2008-09-19 02:35

I don't understand your question. Come again?

Deivids

Avatar: Deivids

2011-10-19 20:23

Are you sure it's not possible to show products from one or several specific pages (categories) by their ID? Maybe I can create a new field in products and use it as random products selector?

Back to top
about us | contact