I'm trying to make the following work in my Wordpress site...
I've got external filters working, so when I display searchresults I'll get the sidebar filters showing Brands, Categories and Marchants (thanks David!) in a list..
Now I would like to display all the avaliable Brands, Categories and Merchants when the search is not active. For example, when you enter my frontpage the sidebar shows the list of all the brands, categories and merchants in the sidebar.
I've been trying to get this done by tweaking copies of brands.php and html/atoz.php and call them from the filterscript (if isset.... else require brandsExternal.php)...
Now I've got two problems:
1. In my "brandsExternal" (which sets all the variables like searchExternal) the URL are not set in a correct way (e.g. a link to brand is like /PT/BrandA/ instead of PT/brands/BrandA. Please have a look at {link saved} .
2. When I user this method I've got to make categoriesExternal and MerchantsExternal as well, also calling a different version of atop.php..
Can you help me with this one? I've got a strong feeling it's only adding three lines of code to the filtersExternal.php....
Cheers,
Koen
Hi David,
Thanks for your reply.. I don't think I understand you..
When I use a page genereaterd by searchExternal.php I see a URL like http://[domain]/?page_id=257 (generated by Worpress I guess...). Within this page the searchexternal results are shown.
When I only use the ? (the code I use is:)
$item["href"] = "/?pt=1q=brand:".urlencode($product["brand"]).":";
This doesn't work. do you have a clue how to get the link working?
Thanks a lot,
Koen
Hi Koen,
Sorry about that - I missed an "&" out of the URL - please try:
$item["href"] = "/?pt=1&q=brand:".urlencode($product["brand"]).":";
Cheers,
David.
--
PriceTapestry.com
thanks David,
the link is now still searching in het "root" of my site. It misses the link to the PT installation and the search script. e.g. http://test.benlow.nl/?pt=1&q=brand:Ben+Sayers:
I found it working when I insert "/PT/search.php" in front of the code, but this gives me pretty ugly links. Is there a way to het it done without hardcoding and with clean URLs?.
Thanks,
Koen
Hi Koen,
The /PT/ clean URL would be:
/PT/brand/Brand-Name/
...which would be created using:
$item["href"] = "/PT/brand/".tapestry_hyphenate($product["brand"])."/";
Hope this helps,
Cheers,
David.
--
PriceTapestry.com
Hi Koen,
What's happening is that because you have $config_useRewrite enabled the brands (and same for the category / merchant) files are creating the URL simply as "name/" (because with rewrite enabled the current page URL is already "brand/" so that makes the resulting clean URL of /brand/name/.
All you need to do is make a note of your working external search results page for a query. e/g/
/somepage?pt=1&q=foo
(where your search external shows results for "foo")
Then, in your brandsExternal.php look for the following section:
if ($config_useRewrite)
{
$item["href"] = urlencode(tapestry_hyphenate($product["brand"]))."/";
}
else
{
$item["href"] = "search.php?q=brand:".urlencode($product["brand"]).":";
}
...and REPLACE with just:
$item["href"] = "/somepage?pt=1q=brand:".urlencode($product["brand"]).":";
(where /somepage... etc. is as identified above)...
Hope this helps!
Cheers,
David.
--
PriceTapestry.com