cleanFor

cleanFor ( string text , string _typeOfCleanning , int _maxCaracter ) : string

Remove incompatible caracters

Example


console(cleanFor("Hello world#;", "PS-GenericName")) // -> "Hello world"

Parameters

text

The text to clean.

_typeOfCleanning (optional)

• PS-GenericName (default) : remove <>;=#{}. Recommanded in Prestashop for attribute, attribute groups (combinations), supplier, manufacturer, feature, feature value, category, taxes, image legend, tags
• PS-Reference : replace <>;={} by _ . Recommanded in Prestashop for reference
• Normal-Caracters : replace caracters other than A to Z, 0-9, space and .+\\-*/=,_ by a _. Accented caracters are replaced.
• Number : replace others than 0-9 caracters

_maxCaracter (optional)

default:none
For Prestashop :
• Supplier : 64
• Manufacturer : 64
• Feature : 127
• Feature value : 254
• Product reference : 32
• EAN13 : 13
• UPC : 12
• Product name : 127
• Short description : 800 (see PS_PRODUCT_SHORT_DESC_LIMIT in config)
• Category name : 127
• Taxes Names : 49
• Image legend : 127