Jump to content

Random products on product page


Recommended Posts

Currently product categories module displays products from same categories on products page.

I want to display random products instead, so that users can redirected to other category products.

Is there any FREE module available for this?

Or how do I modify the existing module to make this change.

Please help.

Thank you.

Link to comment
Share on other sites

Yes I use the default module. But I am unable to find where it fetches products. Any ideas?

 

modules/productscategory/productscategory.php

there is a code like:

 

$category = new Category((int)$product->id_category_default);

then $category uses getProducts function.

 

in this case it's necessary to duplicate Category class getProducts function to something like:

getRandomProducts

and remove from sql query where condition:

AND cp.`id_category` = '.(int)$this->id
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...