You are here:  » Short Description for Merchant

Support Forum



Short Description for Merchant

Submitted by MikeyC on Sat, 2009-04-04 09:01 in

Hi David,

How can i add a short description for Merchants on the merchants page ?

Submitted by support on Sat, 2009-04-04 09:30

Hi Mikey,

You could do this in a very similar way to other mods whereby you can create your text descriptions in a sub-directory, called "merchantinfo".

Create a folder called merchantinfo in your main Price Tapestry installation folder, and then create files inside that folder for each merchant that you wish to provide a description for with the filename:

Merchant Name.txt

...where "Merchant Name" is the exact merchant name as entered when you registered their feed. The .txt extension just makes it easier to edit these files in your text editor so that it knows the file type.

Now, this modification can be made a single place to avoid having to create multiple versions of html/atoz.php. Instead, in merchants.php, look for the following code on line 14:

$item["name"] = $feed["merchant"];

...and REPLACE this with:

$filename = "merchantinfo/".$feed["merchant"].".txt";
if (file_exists($filename))
{
  $info = file_get_contents($filename);
  $item["name"] = $feed["merchant"]."</a><p>".$info."</p><a>";
}
else
{
  $item["name"] = $feed["merchant"];
}

...and that should display your merchant descriptions nicely within P tags below the merchant name on the Merchant A-Z page!

Cheers,
David.

Submitted by MikeyC on Sun, 2009-04-05 17:00

Thanks David

Submitted by MikeyC on Sun, 2009-04-05 17:53

Hi David,

I am getting the following error;

Parse error: syntax error, unexpected '"', expecting T_STRING or T_VARIABLE or T_NUM_STRING in merchants.php on line 31

Submitted by support on Mon, 2009-04-06 07:45

My apologies Mikey,

I missed of a closing " on this line in the above code:

$item["name"] = $feed["merchant"]."</a><p>".$info."</p><a>";

I've corrected the code above also.

Cheers,
David.

Submitted by MikeyC on Mon, 2009-04-06 16:36

Thanks David, it works great !

Submitted by MikeyC on Mon, 2009-04-06 18:18

David,

Will the text also be seen by crawlers ?

Mike

Submitted by support on Mon, 2009-04-06 19:36

Hi Mike,

Sure - the text is included when the page is generated - before it is sent to the browser, so it will be seen by anyone / anything (i.e. crawlers) browsing that page!

Cheers,
David.

Submitted by MikeyC on Sun, 2012-12-02 11:08

David,

Is there a way i can add this in the database, by adding a merchant description field in the back end in which i can type the description ?
Btw, I implemented the first part from the mod on this thread: Edit Register / Feeds
Don't know if it will be affected.

Submitted by support on Sun, 2012-12-02 12:02

Hi Mikey,

Do you have a 1-1 merchant to feed mapping so that the description could be added in a field on Feed Registration Step 2 (e.g. indexed by filename rather than merchant sepecifically) or do you use multi-merchant feeds?

Cheers,
David.
--
PriceTapestry.com

Submitted by MikeyC on Sun, 2012-12-02 12:10

I am using 1-1 merchant feeds, but some merchants have their categories splitup over several files, so in some cases i'll up more feeds per merchant, but the description will be the same.
I don't use the multi merchant feeds, if you mean a feed with more merchants in one file ?

Submitted by support on Sun, 2012-12-02 12:15

Thanks Mikey it would need to be separate from Feed Registration (Step 2) then - no problem - bear with me and when I'm back in office tomorrow i'll take you through the steps of creating a simple admin page to manage merchant descriptions.

Cheers,
David.
--
PriceTapestry.com

Submitted by MikeyC on Sun, 2012-12-02 12:18

Thanks David

Submitted by support on Mon, 2012-12-03 11:14

Hi Mikey,

I've created a simple /admin/ area for merchant info which I'll email to you in just a moment...

Cheers,
David.
--
PriceTapestry.com