简体   繁体   中英

Superscript characters in Prestashop 1.7 product name

One of the products in my website has a superscript character in the product name. Since Prestashop does not allow HTML tags inside product names, I need to find a way to display the superscript character correctly in the product page.

While searching around, I found somebody with a similar problem: https://www.prestashop.com/forums/topic/543339-how-to-make-superscript-format-%C2%AE-symbol-in-category-name-and-product-name/ . They seemed to resolve the issue by modifying a line of code in the product.tpl file of their theme:

 <h1 itemprop="name">{$product->name|escape:'html':'UTF-8'|replace:'character':'<sup>character</sup>'}</h1>

I tried this solution, but instead of replacing only the one character with its superscript version, the theme displays the entire string as plain text, including the sup tags. Cleared the cache, set to force recompile template files, nothing.

Clearly the "replace" command does work, but I can't figure out why the sup tags don't. Does anybody know a way to solve this problem?

Use the unicode equivalent of the superscript digits instead.

See https://unicode-table.com/en/sets/superscript-and-subscript-numbers/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM