Nyphel Posted October 24, 2015 Share Posted October 24, 2015 Hello, I can't understand why, if I try to create a new product using a PHP script, the product name cannot contain accents? If I try to create same product using Admin page, accents are allowed... Am I doing something wrong in my PHP script? $myProduct = new Product(); $myProduct->ean13 = 9999999999999; $myProduct->name = array((int)Configuration::get('PS_LANG_DEFAULT') => 'téàè°st'); $myProduct->link_rewrite = array((int)Configuration::get('PS_LANG_DEFAULT') => 'test'); $myProduct->id_category = 7; $myProduct->id_category_default = 7; $myProduct->redirect_type = '404'; $myProduct->price = 10.0; $myProduct->quantity = 1; $myProduct->minimal_quantity = 1; $myProduct->show_price = 1; $myProduct->on_sale = 0; $myProduct->online_only = 0; $myProduct->meta_keywords = 'test'; $myProduct->is_virtual=0; $myProduct->add(); $myProduct->addToCategories(array(7)); Le champ suivant n'est pas valide selon la méthode de validation isCatalogName: (Product->name = pour la langue 2) Is there an encoding to be defined in PHP source code? Thanks for your help. Link to comment Share on other sites More sharing options...
Nyphel Posted October 25, 2015 Author Share Posted October 25, 2015 Thanks to Eolia, this issue has been explained and solved in French forums: https://www.prestashop.com/forums/topic/478104-créer-un-produit-via-php-accents-interdits-dans-le-nom-du-produit Simply set the IDE encoding to UTF-8 encoding without BOM. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now