Which files do I need to adjust or override to make prestashop 1.7 let me use the #
symbol in product titles?
I searched Google and tried different methods that worked in previous versions of prestashop (like editing the validate.php file etc) but none of them made any difference at all.
I asked this on the prestashop forum, and was told they do not recommend overriding this due to it being an html tag, and was told to use the musical symbol for sharp instead, I then asked what this would do for search results as people search using the hashtag symbol not the music symbol and why other platforms like shopify (which is virtually identical) do not put the same restriction in place and now nobody is talking about it.
Please note I am new to coding so a step by step guide would be great. I have tried to be as detailed as possible but If anyone needs any more info please ask.
As requseted in the comment here is the link to the prestashop forum question. https://www.prestashop.com/forums/topic/617693-how-do-i-use-in-product-title/
2
Answers
Allow the # symbol in Product Name/Title field in PrestaShop V1.5+
I ran into this same issue. You can fix this by creating a simple override. Doing it this way ensures that updates to Prestashop will install and function as desired. This will not change any of the primary back end code, it simply extends a single function.
Create a new file and name it Validate.php – Paste the following into it.
This new file needs to then be saved/uploaded to. /override/classes/Validate.php
Final step: You need to delete the single file: /cache/class_index.php from the server. This file will then be automatically re-created on the next load of your admin area. The new class_index will contain your new override, and you can begin adding products with # character in the product name.
That’s It!
Learn about creating overrides in Prestashop. If you are hesitant about deleting the class_index.php file, don’t worry, it’s very common. You can read about deleting that file here.
The only solution I found is to change a pattern in this file:
srcPrestaShopBundleFormAdminProductProductInformation.php
at row 145 change
to
pattern' => '/[<>;={}]/'
Hope this help.
Cheers