You are here:  » Productsmap product count

Support Forum



Productsmap product count

Submitted by paddyman on Mon, 2010-09-06 19:58 in

Hi David,

Just wondering how to print the number of products in the productsmap table in productsmap.php ?

Thanks

Adrian

Submitted by support on Tue, 2010-09-07 07:49

Hi Adrian,

To display the number of alternatives in brackets alongside each master product name, in admin/productsmap.php look for the following code at line 64:

print "<th align='left'>".$productmap["name"]."</th>";

...and REPLACE with:

$count = count(explode("\n",$productmap["alternates"]));
print "<th align='left'>".$productmap["name"]." (".$count.")</th>";

Cheers,
David.
--
PriceTapestry.com

Submitted by paddyman on Tue, 2010-09-07 07:53

Hi David,

Many thanks for your reply. Should have explained myself better, wasn't looking for the above solution but it will actually come in very handy :)

I'm only looking for the total number of rows in the productmap table and to display that at the end of admin/productsmap.php.

Thanks

Adrian

Submitted by support on Tue, 2010-09-07 08:22

Hi Adrian,

Ah - in that case, simply insert the following new code:

  print "<p>Total Mappings: ".count($rows)."</p>";

...just before the following code at line 80:

  print "<h3>New Product</h3>";

Cheers,
David.
--
PriceTapestry.com

Submitted by paddyman on Tue, 2010-09-07 12:24

Excellent,

Thanks for that.

Adrian