Jump to content

Random product in home


Recommended Posts

Hi,

 

I've searched and still did not find anything that works. A few modules here and there but they never seem to work.

 

I'm in need of a module to show random products from all of my categories in the home page. Not featured items or new items. Just random items from all my products.

 

Presat version PrestaShop™ 1.4.6.2 . Any ideas anyone or tips?

 

Thanks and regards,

Mark

Link to comment
Share on other sites

Im just in the same way...!

From other similar engines there is just a part of the main modules to have a random show of the products. But prestashop seems to have NOT this so easy, I ever download and try many modules, but no one of them make that easy thing... take a random view in the front store from all products in catalog.

Pls help!

 

Regards

Adam

Link to comment
Share on other sites

  • 2 months later...

Help is at hand right here: http://iwanmadan.com...roduct-listing/

If you have more than 100 products, this does not really do the job. The products shown will always be selected from the first 100.

 

And you do not need load all 100 products' every detail to memory to select some of these to display; home page is a busy page. A better way is to select ids of however many product you want to display at random and then retrieve the details of products with those ids from the DB only.

 

Inspect the _getRandomProducts method of free Random Featured module to see a way to overcome both of the above mentioned issues No longer available.

Edited by phrasespot (see edit history)
  • Like 1
Link to comment
Share on other sites

  • 2 months later...

Try this

edit file a change one line.

/modules/homefeatured/homefeatured.php

etc line 99

[...]
$products = $category->getProducts((int)($params['cookie']->id_lang), 1, ($nb ? $nb : 10),NULL,NULL,false,true,true /*Random*/, ($nb ? $nb : 10));
[...]

  • Like 4
Link to comment
Share on other sites

  • 2 months later...
  • 3 weeks later...

Try this

edit file a change one line.

/modules/homefeatured/homefeatured.php

etc line 99

[...]
$products = $category->getProducts((int)($params['cookie']->id_lang), 1, ($nb ? $nb : 10),NULL,NULL,false,true,true /*Random*/, ($nb ? $nb : 10));
[...]

 

it helps! thanks ...

  • Like 1
Link to comment
Share on other sites

  • 11 months later...

Try this

edit file a change one line.

/modules/homefeatured/homefeatured.php

etc line 99

[...]
$products = $category->getProducts((int)($params['cookie']->id_lang), 1, ($nb ? $nb : 10),NULL,NULL,false,true,true /*Random*/, ($nb ? $nb : 10));
[...]

It worked, kudos man ;)

Link to comment
Share on other sites

  • 1 month later...
  • 1 year later...

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