Hi David,
How can i add a short description for Merchants on the merchants page ?
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
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.
David,
Will the text also be seen by crawlers ?
Mike
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.
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.
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
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 ?
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
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
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.