Hi,
I want to display the merchant names and some merchant specific information by including it into the featured.php.
How can this be done?
For example I have two merchants:
Merchant A
Merchant B
I want the featured products to display the merchant information too if a product of that Merchant is featured.
E.g.
Merchant A is the best online retailer
Merchant B has a very good reputation
Hi,
The merchant information is copied into other merchants products.
See this url:
{link saved}
This is my featured.php:
{code saved}
Hi Marco,
For it to work at that point in the loop, just use this instead:
<?php
$merchantInfoFilename = "merchantinfo/".$product["merchant"].".html";
if (file_exists($merchantInfoFilename))
{
require($merchantInfoFilename);
}
?>
Cheers,
David.
--
PriceTapestry.com
Hi Marco,
That's easy to do!
Create a new folder on your installation called merchantinfo/
Inside that folder, create files called Merchant Name.html (where Merchant Name is exactly as it appears on your site, including capitals letters and spaces, containing the HTML you want to appear for that merchant.
Then, inside your html/featured.php, either at the beginning or end - wherever you want to include the merchant info, use this:
<?php
foreach($featured["products"] as $product)
{
$merchantInfoFilename = "merchantinfo/".$product["merchant"].".html";
if (file_exists($merchantInfoFilename))
{
require($merchantInfoFilename);
}
}
?>
Cheers,
David.
--
PriceTapestry.com