Hi David,
I have a product mapping question for you!
A bit of context first though. On my site I do a lot of product mapping, normally just at product level, but increasingly I'm starting to use it to pull groups of products together too. For instance by brand - "brand trousers" or "colour trousers"
What I was wondering is: is it possible to map things twice in some way? Here's an example to detail what it is I'm trying to achieve. I have lots of trousers on my site an notice that there's good search volume for both trousers by brand and trousers by colour. Therefore I want to write 2 wordpress posts optimised for each and pull in pricesExternal. I don't want to use searchExternal because the results are a bit messy (something which I can control and improve the presentation of with by mapping first)
Hope you're still with me! So, in essence, I'd like to be able to use pricesExternal to display results for "brand trousers" and "colour trousers", where some of the products would need to be mapped into a "brand trousers" and a "colour trousers".
Hope this makes sense. Hope there's a way to do it?
Thanks,
Neil
p.s. I won't need to use this an awful lot but enough to want to ask the question.
Hi Neil,
pricesExternal.php would only work for a specified product, but search by brand is already supported by serachExternal.php / external.php, and can be easily extended to include keywords, and at the same time support a colour search including keywords, assuming that you have added colour as an additional field to your site.
In your external.php or searchExternal.php, look for this section of code by searching for case "merchant" using your text editor's search function:
case "merchant":
// pass through to category
case "category":
// pass through to brand
case "brand":
$fields = array("merchant","category","brand");
...and REPLACE that with:
case "merchant":
// pass through to category
case "category":
// pass through to brand
case "brand":
case "colour":
case "name":
$fields = array("merchant","category","brand","colour","name");
...and then a little further down, look for this code:
$where .= " ".$field." = '".database_safe($parts[$i])."' ";
...and REPLACE that with:
if ($field == "name")
{
$where .= " name LIKE '%".database_safe($parts[$i])."%' ";
}
else
{
$where .= " ".$field." = '".database_safe($parts[$i])."' ";
}
With that in place, you'll be able to use $_GET["q"] values such as:
brand:Brand Name:Trousers
colour:Colour:Trousers
Hope this helps!
Cheers,
David.
--
PriceTapestry.com