Jump to content

[SOLVED] Prestashop special characters issue


SzymonBl

Recommended Posts

Hello, 
I've recently come across an issue with special characteras, such as &, or ', display as their html version (not sure how it's called).

This only happens with category page titles, as you can see below
image.png.68e59327f4bcde021d7b879066061ee5.png - title
image.png.cd68ade2d61c084cea9913337178a0a3.png - category list

I've searched a bit but I can't find any solution. Does anyone know what could that be caused by?

PHP 8.0
Presta 8.2
Theme Hummingbird

Edited by SzymonBl (see edit history)
Link to comment
Share on other sites

The issue might be related to how your theme (Hummingbird) handles category page titles.

Look for the below terms in your theme files:

category.tpl

or similar template files in your theme folder.

Check for the

{$category.name}

or similar variable used to display the title.

If the title is being passed through a function like:

htmlspecialchars()

or

escape('html')

it could be causing double encoding.

Fix: Ensure it's only escaped once by removing unnecessary encoding functions. Use {strip} or ensure proper escaping like {$category.name nofilter}.

  • Thanks 1
Link to comment
Share on other sites

Okay adding nofilter to variable fixed it, but only after I changed block name

{block name='product_list_header1'}

      <h1 id="js-product-list-header" class="h2 mb-4">{$listing.label nofilter}</h1>

    {/block}

It now looks like this, for some reason everything is okay

 

Link to comment
Share on other sites

  • SzymonBl changed the title to [SOLVED] Prestashop special characters issue

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...