You get a bonus - 1 coin for daily activity. Now you have 1 coin

Opencart tag search doesn't work correctly (case and encoding issues)

Practice




Opencart tag search doesn't work correctly

check the tag descriptions on each product
are there any capital letters there?
this can be fixed in the database with a single query

UPDATE `YOUR-PREFIX_product_description` SET `tag`= LCASE (tag)


and you should also double-check that there are no Cyrillic О, Е and similar English letters that look very much like Russian ones, otherwise it won't find them by tag, because despite the visual similarity these characters have completely different encodings

on my site now diamond-with-question-mark symbols appear instead of Russian letters in the tag link (probably something is wrong with the encoding), please help fix it

in the controller /catalog/controller/product/product.php add the 'UTF-8' encoding

foreach ($tags as $tag) {
$this->data['tags'][] = array(
'tag' => trim($tag),
'href' => $this->url->link('product/search', 'filter_tag=' . mb_strtolower(trim($tag), 'UTF-8'))
);
}

Comments

To leave a comment

If you have any suggestion, idea, thanks or comment, feel free to write. We really value feedback and are glad to hear your opinion.
To reply

Lectures and tutorial on "Running server side scripts using PHP as an example (LAMP)"

Terms: Running server side scripts using PHP as an example (LAMP)