Hi David
How to display number of merchant like this :
Nokia 302
(image)
(3 seller)
(price)
Thank you
amin
technoarenasol
Hi David...Its working but also count variant products means count 3 If three variant products in one seller ..
1st seller : 1 variant
2nd seller : 3 variants
3rd Seller : 1 variant
So its display (5 seller)
Hi, technoarenasol
This would require a re-query since the search results are generated from a summary query. It will be fast so shouldn't cause any problems but keep an eye on page load time. Firstly, add the following code at the top of html/searchresults.php
<?php
function numSellers($name)
{
global $config_databaseTablePrefix;
$sql = "SELECT DISTINCT(merchant) FROM `".$config_databaseTablePrefix."products` WHERE name='".database_safe($name)."'";
return database_querySelect($sql,$result);
}
?>
Then as an alternative to the original replacement; use:
<br /><?php print numSellers($product["name"]); ?> Seller
<?php endif; ?>
Cheers,
David.
--
PriceTapestry.com
Hello Amin,
In html/featured.php within the loop to display each featured product you can use the following code wherever required:
<br /><?php ?> Seller
So for example to show the number of sellers after the image; look for the following code at line 12:
<?php endif; ?>
...and REPLACE with:
<br /><?php print $product["numMerchants"]; ?> Seller
<?php endif; ?>
Cheers,
David.
--
PriceTapestry.com