Hi David,
I know there was previously a post on having merchant A (higher commission) appear above Merchant B when both are showing the same price. Tried searching and can't find it. Can you point me in the right direction?
Thanks
Adrian
Cool!
Just a note to anybody implementing this - the best commission merchant isn't always the best converting! So it might be worth doing some tests to see who actually earns you the most regardless of their headline commission rate...
Cheers,
David.
that very strange
I was just searching for the same thing and found this thread.
do we use the 'merchant name' as we have them in our merchant page?
Hi,
Yes, the text in the SQL must match exactly the merchant name as you registered it - which will be the same as appears in the merchant page.
Cheers,
David.
Hello,
Is something like this also possible for search page? e.g. putting preferred merchant(s) before other merchant when the relevance is the same?
Regards,
Marco.
Hello Marco,
It shouldn't be a problem on the search page as products are grouped by name anyway; and the cheapest price will always be shown. The only situation in which I can see this helping is if products are actually the same but have slightly different names, in which case I would recommend using Product Mapping to make the names the same as a better alternative...
Cheers,
David.
Hi David
If I want to want to knock a merchant down the list because of poor conversion, would this work okay:
$sql = "SELECT *,
CASE merchant
WHEN 'Best Merchant' THEN 1
WHEN 'Worst Merchant' THEN 99
ELSE 98
END as preference
FROM `".$config_databaseTablePrefix."products` WHERE name = '".database_safe($q)."'
ORDER BY price,preference LIMIT ".$config_resultsPerPage;
That way they would still show if there was no other merchant available (I restrict to 5 results when using PricesExternal.php), but not if there were more than 5 results.
Hi atman,
If you wanted to add a new config variable, use something like:
$config_bestMerchant = "Merchant Name";
...and then in the modification described above; instead of:
CASE merchant
WHEN 'Best Merchant' THEN 1
WHEN 'Second Best Merchant' THEN 2
ELSE 99
use:
CASE merchant
WHEN '".$config_bestMerchant."' THEN 1
ELSE 99
Cheers,
David.
Hi David,
Trying to implement this in the new distribution.
Have changed code as follows, but getting product not found. Also using the totalprice mod which is working fine.
$sql = "SELECT *,
CASE merchant
WHEN 'HMV' THEN 1
WHEN 'Asda' THEN 2
ELSE 99
END as preference
(price+delivery) AS totalprice FROM `".$config_databaseTablePrefix."products` WHERE normalised_name = '".database_safe($q)."'
ORDER BY totalprice,preference LIMIT ".$config_resultsPerPage;
Any ideas ?
Thanks
Adrian
Hi Adrian,
Just looks like a comma missing after "END as preference" - that should be all it is!
Cheers,
David.
Hi Adrian,
I can't find it either i'm afraid but it's a straight-forward mod. The existing SQL to select products is in products.php at line 12:
$sql = "SELECT * FROM `".$config_databaseTablePrefix."products` WHERE name = '".database_safe($q)."' ORDER BY price LIMIT ".$config_resultsPerPage;
...so if you replace that with:
$sql = "SELECT *,
CASE merchant
WHEN 'Best Merchant' THEN 1
WHEN 'Second Best Merchant' THEN 2
ELSE 99
END as preference
FROM `".$config_databaseTablePrefix."products` WHERE name = '".database_safe($q)."'
ORDER BY price,preference LIMIT ".$config_resultsPerPage;
This would mean you could actually rank your merchants in order of commission (just add more WHEN 'Merchant Name' THEN x etc. lines with increasing numbers so that you will always be promoting your favourite merchants above others for the same price.
Cheers,
David.