News and articles
Discounts on modules and templates in March

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

Top-selling templates and extensions in February 2026: Komplekt-Expert, Telegram Notifications, IMDBOptimizer (OC 3) - Database Optimization, #FX Sitemap - Ultra-fast Sitemap, Lightshop template.

 
 
 
 
 
A selection of new modules for OpenCart for February 2026

New releases for February 2026: Quiz for OpenCart, Redirect & Loop Monitor, Admin Panel on the Website, Brand Collection.

 
 
 
 
 
LiveStore on Beget
26 February 2026 16:07:29
LiveStore on Beget

Our assembly appeared in the quick installation of CMS hosting beget

 
 
 
 
 

How to use Emoji (emoji) in CMS Opencart?

Emoji in OpenCart: MySQL encodings and editing mysqli.php for correct storage
How to use Emoji (emoji) in CMS Opencart?

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.

Why standard utf8 in MySQL is not suitable

  • utf8 inMySQLis not a full UTF-8, but a 3-byte version of it (utf8mb3).
  • Any characters that require 4 bytes (emoji, some hieroglyphs, rare characters) are not saved in this encoding.
  • MySQL either replaces them with ? or refuses the entry.
  • The only correct solution is to use utf8mb4.

Where do OpenCart actually use emoji

In practice, emoji are most often used not only in texts, but also in marketing elements:

  • Product name and description
  • Description and category title
  • Reviews and comments
  • SEO fields: Title, Description
  • Titles of articles, blogs, information pages
  • Texts of letters (mailings, notifications)

Therefore, it is important to recode exactly those tables where such data is actually stored.

Action plan

  1. Make a database backup.
  2. Convert the database and tables to utf8mb4.
  3. Fix OpenCart connection with MySQL (mysqli.php).
  4. Check data saving and display.

Step 1. Database backup

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

Step 2. Converting the database and tables to utf8mb4

2.1. Default base encoding

ALTER DATABASE `DB_NAME`
  CHARACTER SET utf8mb4
  COLLATE utf8mb4_unicode_ci;

Thissets the default encoding, but does not always automatically recode existing tables.

2.2. Recoding tables

Main OpenCart tables where emoji are most often needed:

  • oc_product, oc_product_description
  • oc_category, oc_category_description
  • oc_review
  • oc_information, oc_information_description

Example command:

ALTER TABLE oc_product_description
  CONVERT TO CHARACTER SETutf8mb4
  COLLATE utf8mb4_unicode_ci;

Repeat for all required tables.

2.3. Checking the columns

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;

Step 3. Fixing the MySQL connection in OpenCart

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.

Step 4. Checking the result

  1. Add emoji to a product description, category or review.
  2. Save your data.
  3. Check table contents directly indatabase.
  4. Make sure that the data is displayed correctly on the site.

Example of emoji for verification

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.

Typical problems

Emojis are saved as question marks

  • Connection not fixed (set_charset is still utf8).
  • Not all tables or fields have been recoded.
  • Data is imported from an old dump with incorrect encoding.

Everything is correct in the database, but it is displayed incorrectly on the website

  • Check <meta charset="UTF-8"> in the template.
  • Check to see if there are any filters that are cutting orconvert text.
  • Clear OpenCart and template caches.

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.


Recommended to view
Recommended to read


Leave a comment text_write_hint