Current discounts on payment modules, uploads to Yandex, modules from Serbulenko and opencart-cms.ru, Unishop2 template and GigantFilter.
Top-selling templates and extensions in February 2026: Komplekt-Expert, Telegram Notifications, IMDBOptimizer (OC 3) - Database Optimization, #FX Sitemap - Ultra-fast Sitemap, Lightshop template.
New releases for February 2026: Quiz for OpenCart, Redirect & Loop Monitor, Admin Panel on the Website, Brand Collection.
If you try to save emoji in OpenCart (for example, in a product description, review, category, or even in SEO fields), one of the following often happens: the characters turn into ????, are not saved at all, or cause a database write error. Almost always the reason is the same - the database and/or connection to MySQL uses the utf8 encoding (actually utf8mb3), which does not support 4-byte characters.
Emoji are specifically 4-byte characters, so for them to work correctly in OpenCart you need to switch to utf8mb4.
utf8mb3).? or refuses the entry.utf8mb4.In practice, emoji are most often used not only in texts, but also in marketing elements:
Therefore, it is important to recode exactly those tables where such data is actually stored.
utf8mb4.Before any changes be sure to do dump the database:
mysqldump -u USER -p DB_NAME > backup.sql
For large databases, it is recommended to compress immediately:
mysqldump -u USER -p DB_NAME | gzip> backup.sql.gz
ALTER DATABASE `DB_NAME`
CHARACTER SET utf8mb4
COLLATE utf8mb4_unicode_ci;
Thissets the default encoding, but does not always automatically recode existing tables.
Main OpenCart tables where emoji are most often needed:
oc_product, oc_product_descriptionoc_category, oc_category_descriptionoc_reviewoc_information, oc_information_descriptionExample command:
ALTER TABLE oc_product_description
CONVERT TO CHARACTER SETutf8mb4
COLLATE utf8mb4_unicode_ci;
Repeat for all required tables.
SHOW FULL COLUMNS FROM oc_product_description;
If individual fields remain in utf8, they can be changed point by point:
ALTER TABLE oc_product_description
MODIFY `description` LONGTEXT
CHARACTER SET utf8mb4
COLLATE utf8mb4_unicode_ci;
Even if the table encoding is correct, emoji will not be saved if the connection to MySQL is established in utf8.
Open the file:
system/library/db/mysqli.php
Find the line:
$this->connection->set_charset("utf8");
And replace it with:
$this->connection->set_charset("utf8mb4");
If the project uses another driver (mpdo, mysql), check the same setting there.
To quickly check that the utf8mb4 encoding is working correctly, use emojis, which are guaranteed to be 4-byte characters.
Copy and paste the following text into any OpenCart text field:
Emoji test: 😀 🚀 🔥 👍 💡 ❤️ ⭐ 🛒
If, after saving, the emoji are correctly stored in the database and displayed on the site showcase, then the encoding and connection to MySQL are configured correctly.
If the symbols turn into question marks or disappear, it means that somewhere elseutf8 is used instead of utf8mb4.
set_charset is still utf8).<meta charset="UTF-8"> in the template.After this, the emoji will be stably saved and displayed correctly in all parts of the store - from product descriptions to SEO fields and letters.
а статья очень подробная и полезная для тех у кого возникли такие проблемы
В статье указано найти по пути system/library/db/mysqli.php: $this->connection->set_charset("utf8"); В реале есть нюанс:$this->connection->set_charset('utf8');Зашел в установочные файлы, смотрю чрз Notepad :ermm:
if (!$mysqli->connect_errno) { mysqli_report(MYSQLI_REPORT_ERROR); $this->connection = $mysqli; // $this->connection->report_mode = MYSQLI_REPORT_ERROR; $this->connection->set_charset('utf8'); $this->connection->query("SET SESSION sql_mode = 'NO_ZERO_IN_DATE,NO_ENGINE_SUBSTITUTION'"); } else { throw new \Exception('Error: Could not make a database link using ' . $username . '@' . $hostname . '!'); }