Jump to content

Prestashop 1.7.8.8 - How to Allow = character to work in Product titles?


pad420

Recommended Posts

Hello.

Im trying to allow the = character in product titles but to no avail. 🥲
I already tried  editing the isCatalogName function in validate.php changing it from:
 

    /**
     * Check for product or category name validity.
     *
     * @param string $name Product or category name to validate
     *
     * @return bool Validity is ok or not
     */
    public static function isCatalogName($name)
    {
        return preg_match(Tools::cleanNonUnicodeSupport('/^[^<>;=#{}]*$/u'), $name);
    }

To:
 

    /**
     * Check for product or category name validity.
     *
     * @param string $name Product or category name to validate
     *
     * @return bool Validity is ok or not
     */
    public static function isCatalogName($name)
    {
        return preg_match(Tools::cleanNonUnicodeSupport('/^[^<>;#{}]*$/u'), $name);
    }

I also tried this: 
https://stackoverflow.com/questions/44946288/how-do-i-override-prestashop-1-7-to-allow-in-product-titles/45613632#45613632
I could not find the /cache/class_index.php file, I found it in /var/cache removed it but it didn't work too.

Any suggestions? Can't find anything about it online 😐

Link to comment
Share on other sites

in classes/Validate.php locate the line:
 

const NAME_REGEX = '/^[^<>={}]*$/u';

characters inside this are defined as non allowed for specific fields, which include the product title. By removing = from this line you may be able to use it in the product titles.

Don't forget to clear cache after saving changes

Link to comment
Share on other sites

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...