Hi Dave,
Thought I had this one working but didn't seem to do the trick.
Tried this in html/product.php but didn't work. Any suggestions?
$done = FALSE;
$nameMerchants = array("Merchant1","Merchant2");
foreach($nameMerchants as $nameMerchant)
{
foreach($product["products"] as $v)
{
if (($v["merchant"]==$nameMerchant) && ($v["name"]))
{
$product_main["name"] = $v["name"];
$done = TRUE;
break;
}
}
if ($done) break;
}
Hello Zway,
`name` will always be the same for all product records on a product page since this is how they are compared so I'm wondering if you actually wanted to take the `original_name` name field which is the feed name value for each product before mapping, in which case your code would be:
$done = FALSE;
$nameMerchants = array("Merchant1","Merchant2");
foreach($nameMerchants as $nameMerchant)
{
foreach($product["products"] as $v)
{
if ($v["merchant"]==$nameMerchant)
{
$product_main["name"] = $v["original_name"];
$done = TRUE;
break;
}
}
if ($done) break;
}
(note that no need for the second IF condition since `name` / `original_name` will always be set)
Hope this helps!
Cheers,
David.
--
PriceTapestry.com