Closed dimitraros closed 6 years ago
Hello,
If you have set up the extension with us a long time ago, it's possible your product feed is set up to auto-detect the correct encoding. My guess is the addition of the | to all products messed that up somehow. The other possibility is that the $sku
has some different incompatible encoding.
Here is what I would recommend trying:
$title.' '.$sku
same problem? If yes try $title.$sku
? In this case, it's likely the problem is not with | but with $sku has some strange encoding, does it? You may be able to use some php function to sanitize it if so. If you know the source encoding of the $sku you can use this function :
http://php.net/manual/en/function.mb-convert-encoding.phpe.g. $sku = mb_convert_encoding($sku, "UTF-8", "auto");
Hope that helps.
Hi dmitridr
thanks for the reply. I can confirm that both the $title and the $sku variables have no encoding problems ($title.$sku works great but as you can understand i need something that makes more sense), so the problems occurs when i try to insert something in between (eg ' | ' or ' '). I tried to use the mb_convert_encoding function:
$titlenew = $title.mb_convert_encoding(' | ', 'UTF-8').$sku;
or
$titlenew = $title.' | '.$sku; $titlenew = mb_convert_encoding($titlenew, 'UTF-8');
but no luck, i still get the non readable characters.
Very strange. Even when using ' ' ? I wonder why that happens. There are a couple more things to try that I can think of:
Closing this, as it has been a while with no resolution or reply. We cannot reproduce this bug, unfortunately.
Hi, i have a lot of products with the same title and when I try to tag a product, i can't find the one i want, because in every search, Facebook shows me only 10 results. Therefore, i tried adding the Sku in the title with the following format: Title | Sku
i added just after line 190 in FacebookProductFeed.php (buildProductEntry function):
$sku = $product->getSku(); $titlenew = $title.' | '.$sku;
and then changed line 195 to:
$items[self::ATTR_TITLE] = $this->buildProductAttr(self::ATTR_TITLE, $titlenew);
I fetched the products and i can see the new format in Facebook Catalog (with the | separator), but the encoding is wrong and the letters are not readable. All my product titles are in Greek and they were all readable in FB before my code changes. What is wrong with my code that changes the encoding?