Hi David
I am using (testing) automatic product mapping by ean. So far so good.
I was wondering how I can display on the homepage only random featured products, which were automatically mapped by ean?
Kind regards,
Ivo
Hi David
This works, but it seems it is quite heavy on my server resources. Please correct me, if I am wrong.
Would it help to first define 5 merchants from which to chose these products from? And if so, how would I do that?
Kind regards,
Ivo
Hello Ivo,
Selecting a random merchant and then random Featured Products from that merchant is the method suggested in the latest random Featured Products mod, however if you'd prefer to use a pre-defined list of merchants this can be done simply using an IN expression as part of the WHERE clause - have a go with;
$sql = "SELECT DISTINCT(name),1 AS sequence FROM `".$config_databaseTablePrefix."products` WHERE ean <> '' AND name <> original_name AND merchant IN ('Merchant 1','Merchant 2','Merchant 3') ORDER BY RAND() LIMIT 3";
Hope this helps!
Cheers,
David.
--
PriceTapestry.com
Hi David
Finally, I integrated the above code and it works great.
How can I add the condition that the minimum price of the featured products is > 100?
Cheers, IG
Hello Ivo,
Have a go with;
$sql = "SELECT DISTINCT(name),1 AS sequence FROM `".$config_databaseTablePrefix."products` WHERE ean <> '' AND price > '100.00' AND name <> original_name AND merchant IN ('Merchant 1','Merchant 2','Merchant 3') ORDER BY RAND() LIMIT 3";
Cheers,
David.
--
PriceTapestry.com
Hi David
Spot on as always.
There are simply no words for your unbelievable and relentless support!
Cheers,
Ivo
Hello Ivo,
Sure - the standard instructions for random Featured Products are here. The only way to determine that a product was mapped is if name is not equal to original_name (and has an ean), so to include this condition in the WHERE clause, you could use as the first replacement:
$sql = "SELECT DISTINCT(name),1 AS sequence FROM `".$config_databaseTablePrefix."products` WHERE ean <> '' AND name <> original_name ORDER BY RAND() LIMIT 3";
Hope this helps!
Cheers,
David.
--
PriceTapestry.com