PrestaShop 1.7.5订单商品消息区域对应的TPL物理文件位置咨询及UTF-8显示问题修改需求
Hey there! I’ve tackled similar encoding glitches in PrestaShop before, so let’s walk through how to resolve this for you:
Locate the Correct TPL Files
The product message section you’re targeting lives in different templates depending on where you’re viewing the order:
Back Office (Admin Order Details)
The template file you need is:admin/themes/default/template/controllers/orders/_product_line.tpl
Look for lines rendering the product message—you’ll probably see something like{$product.message}here, which is the code outputting the text in your red-circled area.Front Office (Customer Order Details)
If customers also see this encoding issue, check your active theme’s template:themes/[your-active-theme-name]/templates/order-details-product-line.tpl
Search for the variable displaying the product message (often{$product.message}or{$item.message}).
Fix the UTF-8 Encoding Problem
Once you’ve found the relevant line, use PrestaShop’s built-in filter to enforce proper UTF-8 rendering:
Replace the raw variable (e.g., {$product.message}) with:
{convertEncoding $product.message 'UTF-8'}
This ensures the content is parsed and displayed in UTF-8, which should fix the display anomalies you’re seeing.
A couple extra checks to make sure the issue doesn’t come back:
- Verify the TPL file itself is saved with UTF-8 encoding (without BOM)
- Confirm the
messagefield in theps_order_detaildatabase table uses a UTF-8 collation (likeutf8mb4_unicode_ci)
内容的提问来源于stack exchange,提问作者jose angarita

