Hi David
I have a feed for Ikea and the product names have squiggly å etc. They display nicely in the titles, but when typed normally are not found in the search. E.g. One range is the TRÄBY shelf range. Joe public may type in traby (without squiggly) in the searchbox, but no products are found. Is there a way that the search can see special characters as normal ones, or should I just strip them out?
Kelly
Hi David
I haven't been able to get this to work, but not to worry as I'll strip them out for know. I'll keep an eye on analytics to see if people are using the accents and if so I'll reopen the post.
On another note:
featured products - I use the random featured products page on my index page and would like to keep that as is, but also I would like on a currently static page, approx 12 random featured products from a set merchant where the price is over £300. Is this possible to do and if so how?
Many thanks for your time
Kelly
Hi Kelly,
Basically, all you need to do is copy the featured products code from index.php and use it in your static page (i'm assuming that your static page can still execute PHP?). The featured products code is actually the majority of index.php, beginning with:
$sql = "SELECT * FROM `".$config_databaseTablePrefix."featured` ORDER BY sequence";
...all the way down to:
if (isset($featured)) require("html/featured.php");
To use random products from a particular merchant where the price is over £300 simply change the first line to:
$sql = "SELECT *,1 AS sequence FROM `".$config_databaseTablePrefix."products` WHERE merchant='Some Merchant' AND price > '300.00' ORDER BY RAND() LIMIT 12";
...modifying 'Some Merchant', '300.00' and 12 as required...
Hope this helps!
Cheers,
David.
Just what I was after.
Many many thanks - once again
Kelly
How do I get rid of � characters that are coming up in my search as product not found.
I tried $text = preg_replace('�','',$text);
..but I can't write code, so it was a stab in the dark...
Hi,
Where is this text (which sounds like it is not in the same character set as your site) appearing? Can you post (or email if you like) a link to an example...
Cheers,
David.
Here is the link where it is appearing:
{link saved}
Thanks - i've followed up by email...
Cheers,
David.
Hi,
I have similar problem. My site and xml/csv's are in uft-8 coding but I have problem with products name witch contain some polish letters like: ó, ł, ż... Example, when I search "ława Alex" (en: Alex table) script is finding this products, but when I search "ława", no products are founded :(
Could you tell me how to fix it?
ps. sorry for my broken english ;)
Hi Kelly,
Perhaps the best way to handle this is in exactly the same way as I have just suggested in another thread regarding mis-spellings. If the ranges that use special characters are manageble, you could use the modification described here:
http://www.pricetapestry.com/node/2111
...using lines such as:
if (strtolower($word)=="traby") $parts[0] .= " TRÄBY ";
(case doesn't matter in the added word)
Stripping them out is of course an option, as is search and replace on the product names (search "å", replace "a") if you are expecting most users to use the normal character instead of the accented version...
Cheers,
David.