One of my merchants asked that to be listed on the top of the page for the search results. I mean If their products are in the results for any search term, they want to be on the top of the results page. I searched the forum but could not find an answer. Is there any way to do it?
Cheers,
It is OK for me. I can show the results of promoted merchant by using the "user_searchresults_before.php". But I want to limit the number of the results by 2 or 3. My question is which code should I copy and paste?
Cheeers.
Hello Kempo,
It's not quite so straight forward to patch into user_searchresults_before.php and probably needs to go into the main search.php. Could you email me your search.php and i'll have a go at this for you...
Cheers,
David.
Hello David,
This topic is quite interesting. Can we put relevant advertisement above the search results output something like google but instead we manage our ad.
For example, when a user search for electronic item, them the system will display advertisement related to electronic to be appeared. These ad is coming from the merchant(s) which sell electronic items.
thanks
jack
Hello Jack,
By advertisment, do you mean some advertising content that you manage separately using banner ads and other creatives provided by your merchants (via the affiliate networks), or do you want to pick products from random from those feeds and show them as advertisments?
Cheers,
David.
Hello David,
Yeap. advertisement banner and other creatives.
When a user example search for panasonic plasma tv and the results show 10 merchant selling those tv. Now, an advertisement will appear nearest to that keyword search. If 5 of the merchants each has a banner ad or text ad, then it will randomly choose to display.
I was thinking that the last time u did a mod for merchant logo and text under new directory to be appear in merchant.php output. Could that be apply for this one.
thanks
jack
Hello Jack,
Yes - you're exactly right, this could be done the same way. To have a go at this, create a folder called "ads" in the main Price Tapestry directory. In this folder, create HTML files that contain the banner or text ad creative code for each merchant (you would normally copy this directly from the Affiliate Netowork), with a filename of Merchant.html (including spaces if the merchant name has a space).
Now, the place to insert the code to display a random ad from one of the merchants featured on the search results would be in search.php immediately AFTER this line:
require("html/banner.php");
Try something like this for starters:
// create an array of merchants featured on this page of search results
$merchants = array();
foreach($searchresults["products"] as $p)
{
$merchants[] = $p["merchant"];
}
// randomise the array
shuffle($merchants);
// now display the ad of the first merchant that has an ad file in ads/ folder
foreach($merchants as $merchant)
{
$filename = "ads/".$merchant.".html";
if (file_exists($filename))
{
require($filename);
break;
}
}
Hope this helps!
Cheers,
David.
Hi David,
I have been trying to get the above mod to work in the sidebar on my site but nothing is displayed. I thought this might be because the code needed to be contained within the search.php script but I have tried this also but without success. I wondered if you could confirm if the mod above should work within the sidebar script? As you know I’m using a template. Would be grateful for any suggestions you might have.
Thanks in advance.
Regards
Chris
Hello Kempo,
The difficulty here is that the search SQL performs a summary query in order to generate the price comparison on the search page. The best alternative I can think of would be to effectively run 2 separate instances of search & search results on the first page of the search where the SQL was restricted to the promoted merchant, so this wouldn't stop the products appearing later on, and possible even cheaper... Does that sound reasonable? It's easy to do, just a lot of copy & pasting of code...
Cheers,
David.