You are here:  » Merchant name and merchant specific data into featured

Support Forum



Merchant name and merchant specific data into featured

Submitted by marco@flapper on Wed, 2011-02-23 13:05 in

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

Submitted by support on Wed, 2011-02-23 15:01

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

Submitted by marco@flapper on Wed, 2011-02-23 20:46

Hi,
The merchant information is copied into other merchants products.

See this url:
{link saved}

This is my featured.php:
{code saved}

Submitted by support on Thu, 2011-02-24 09:00

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

Submitted by marco@flapper on Thu, 2011-02-24 09:30

thanks