Hi David,
Just wondering if it would be possible to display the number of merchants compared beside Stockist in the prices table. So if prices were listed for 10 merchants then prices table would show
Stockists (10)
Adrian
Hi David,
Thanks for your reply.
Probably wasn't too clear in my first post as usual :)
Am looking to display the number of merchants which are compared for each individual product and have that number displayed alongside "stockists" in the prices table.
Would this be possible ?
Many thanks
Adrian
Hi Adrian,
Yes - in fact numMerchants is already included in the comparison queries; so it should be available for display. If you could post the section of code surround where you want the number to be included I'll show you how to add it..
Cheers,
David.
Thanks David
From my Prices.php table
<?php
print translate("Stockist");
?>
Cheers
Adrian
Hi Adrian,
Ah, in that case, it's probably easier to use count($products), in other words:
<?php
print translate("Stockist")." (".count($products).")";
?>
Cheers,
David.
Hi David,
Thats returning a value of 0 for each product. Will I send you on my prices.php ?
Cheers
Adrian
Hi Adrian,
Sure - email it over and i'll take a look..!
Cheers,
David.
Hi Adrian,
Use this code to get the number of merchants on your site:
$sql = "SELECT COUNT(*) AS numMerchants FROM `".$config_databaseTablePrefix."feeds`";
database_querySelect($sql,$rows);
$numMerchants = $rows[0]["numMerchants"];
print $numMerchants;
Cheers,
David.