Nous sommes une société de développement spécialiste de projets complexes ou des projets de vente spécifique (Même si chaque vendeur a une méthode de vente spécifique 🙂 )

Pour certains projets informatiques nécessitants une composante de vente en ligne, nous utilisons, grâce à ces modules, Prestashop comme socle de vente et d’encaissement. Cela permet de ne pas ré-inventer la roue et de nous appuyer sur un outil stable, performant, en perpétuelle amélioration comme tout site Internet qui souhaite vendre. Nous l’utilisons comme Framework spécialisé dans la vente en ligne.

En effet, Prestashop a créé un environnement de développement assez efficace pour les développeurs avec ses helpers list et son ObjectModel qui permettent d’obtenir des interfaces d’administration personnalisées assez rapidement et une gestion des objets informatiques assez rapide à mettre en place. Cette simplicité sera à son optimum, lorsque Prestashop sera totalement intégré dans un projet Symfony.

Pour un projet d’envergure international, nous avons été amené à revoir tout le processus de commande avec des contrôleurs spécifiques très éloignés de ceux de Prestashop. En effet dans des projets ayant une certaine complexité, nous déployons un Prestashop tellement modifié qu’il est rarement identifiable au premier abord.

Dans ce projet, nous avons été amené à re-créer un tunnel de commande. Nous avons eu des remontées de clients indiquant qu’ils ne pouvaient pas terminer leur commande. La page d’enregistrement de l’adresse de facturation fonctionnait bien. Par contre sur la page d’enregistrement de l’adresse de livraison, l’adresse était remplacée par les caractères « ? » et un message d’erreur leur indiqué qu’ils ne pouvaient pas poursuivre leur commande.

Mais comment ces clients ont-il pu enregistrer des adresses avec le caractère « ? » alors que Prestashop n’autorise pas ce caractère pour un champs d’adresse ?

Première constatation, tous les clients ayant eu ces problèmes provenaient de régions asiatiques ou russes. Nous soupçonnons donc un problème d’encodage de caractères.

Lorsque nous travaillons sur des projets où le fonctionnement de Prestashop est largement modifié, nous installons systématiquement la même version de Prestashop mais avec une installation basique (Pas de thème spécifique, pas de module ajouté, aucun override, …). Cela nous permet d’avoir une référence de base et tester si un dysfonctionnement provient du code que nous avons généré (Et il peut être important) ou un bug de Prestashop. Oui c’est rare mais cela peut arriver (https://github.com/PrestaShop/PrestaShop/issues). C’est surtout que cela peut être rageant de passer un temps non négligeable à tester pourquoi notre code fonctionne mal alors que le problème provient d’une couche de développement plus basse comme cela a pu être le cas dans l’exemple suivant : https://www.pliciweb.com/tarifs-et-poids-des-declinaisons-qui-disparaissent/.

Par conséquent, avec notre Prestashop de base, nous testons le tunnel de commande avec une adresse écrite en cyrillique. Et là aucun soucis, l’adresse de facturation est bien reprise sur l’adresse de livraison.

Si ce n’est pas la faute de Prestashop c’est donc la notre 🙂 En informatique, l’erreur provient toujours de ce qui se trouve entre le clavier et la chaise.

Il nous reste plus qu’à déterminer si cela provient de nos fichiers ou de la bases de données. Le nombre de fichiers étant important tout comme leur taille, nous commençons par tester la base de données.

Notre idée a été de tester si une adresse de facturation saisie en cyrillique sur la base de test, fonctionne sur notre environnement spécifique. Et lors de la copie grâce à un super outil d’administration de base de données (heidisql), celui-ci nous refuse la copie.

C’est par conséquent la base de données qui pose un problème. Il nous reste plus qu’à regarder quelles sont les différences entre les 2 bases de données. Et là nous nous rendons compte qu’effectivement il y a une différence d’encodage. Toutes nos tables ont pour collation « latin1_general_ci » alors que le Prestashop de base indique une collation ‘utf8_general_ci’.
Une fois la collation modifiée sur notre table, le copier coller de l’adresse cyrillique est acceptée. L’utilisation de notre site Internet confirme la correction.

Afin d’automatiser et dupliquer cette correction, nous allons utiliser un script qui va modifier la collation de la base de données et celle de chaque table.

Script de mise à jour de collation des tables Prestashop
!! Attention de toujours faire une sauvegarde de vos fichiers avant de les modifier. !!

Si vous ne comprenez pas ce que vous faites, ne pas modifier votre fichier et demander à votre agence ou une agence de développement spécialisée dans Prestashop d’apporter ces modifications sur votre site Internet.

Ce fichier ne fonctionne qu’avec le module Developper Tools. A vous de l’adapter en fonction de vos besoins.

modules/pliciwebupdate/data/002_update_tables_collate.php

<?php $collate = 'utf8_general_ci'; $requestDone = 0; try { // Try Databases if (!Db::getInstance()->execute("ALTER DATABASE `" . pSQL(_DB_NAME_) . "` COLLATE '" . pSQL($collate) . "'")) {
        throw new Exception(vsprintf('Unable to alter database', []));
    }
    $requestDone++;
    
    
    // Try tables
    $sqlTablesSql = 'SHOW TABLES';
    
    $sqlTablesList = Db::getInstance()->executeS($sqlTablesSql);
    
    foreach ($sqlTablesList as $sqlTables) {
        $table = array_shift($sqlTables);
        if (!Db::getInstance()->execute("ALTER TABLE `" . pSQL($table) . "` COLLATE='" . pSQL($collate) . "'")) {
            throw new Exception(vsprintf('Unable to update table %s', [$table]));
        }
        $requestDone++;
    }


} catch (Exception $ex) {
    $controller->errors[] = vsprintf('%s script in error : "%s"', [basename(__FILE__), $ex->getMessage()]);
    dump($ex);
    return false;
}

$controller->confirmations[] = '
'.vsprintf('%d requests done', [$requestDone]);

Après l’appel de ce script, nous avons constaté que la collation latin_general_ci était redescendu sur chacun des champs de type text/varchar de chacune des tables de la base.
Nous avons donc utilisé un script qui supprimé toutes ces collations. Utilisable pour une version de Prestashop 1.7.4.2.

Script de mise à jour de collation des tables Prestashop
!! Attention de toujours faire une sauvegarde de vos fichiers avant de les modifier. !!

Si vous ne comprenez pas ce que vous faites, ne pas modifier votre fichier et demander à votre agence ou une agence de développement spécialisée dans Prestashop d’apporter ces modifications sur votre site Internet.

Ce fichier ne fonctionne qu’avec le module Developper Tools. A vous de l’adapter en fonction de vos besoins.

modules/pliciwebupdate/data/003_update_fields_collate.sql

ALTER TABLE `ps_attribute_group`
	CHANGE COLUMN `group_type` `group_type` VARCHAR(255) NOT NULL AFTER `is_color_group`;
ALTER TABLE `ps_attribute_group_lang`
	CHANGE COLUMN `name` `name` VARCHAR(128) NOT NULL AFTER `id_lang`,
	CHANGE COLUMN `public_name` `public_name` VARCHAR(64) NOT NULL AFTER `name`;
ALTER TABLE `ps_attribute_lang`
	CHANGE COLUMN `name` `name` VARCHAR(128) NOT NULL AFTER `id_lang`;
ALTER TABLE `ps_badge_lang`
	CHANGE COLUMN `name` `name` VARCHAR(64) NULL DEFAULT NULL AFTER `id_lang`,
	CHANGE COLUMN `description` `description` VARCHAR(255) NULL DEFAULT NULL AFTER `name`,
	CHANGE COLUMN `group_name` `group_name` VARCHAR(255) NULL DEFAULT NULL AFTER `description`;
ALTER TABLE `ps_carrier_lang`
	CHANGE COLUMN `delay` `delay` VARCHAR(512) NULL DEFAULT NULL AFTER `id_lang`;
ALTER TABLE `ps_cart`
	CHANGE COLUMN `delivery_option` `delivery_option` TEXT NOT NULL AFTER `id_carrier`,
	CHANGE COLUMN `secure_key` `secure_key` VARCHAR(32) NOT NULL DEFAULT '-1' AFTER `id_guest`,
	CHANGE COLUMN `gift_message` `gift_message` TEXT NULL AFTER `gift`,
	CHANGE COLUMN `e_recovery_mode_reference` `e_recovery_mode_reference` VARCHAR(45) NULL DEFAULT NULL AFTER `id_e_parcel`,
	CHANGE COLUMN `checkout_session_data` `checkout_session_data` MEDIUMTEXT NULL AFTER `date_upd`;
ALTER TABLE `ps_cart_rule`
	CHANGE COLUMN `description` `description` TEXT NULL AFTER `date_to`,
	CHANGE COLUMN `code` `code` VARCHAR(254) NOT NULL AFTER `partial_use`;
ALTER TABLE `ps_cart_rule_lang`
	CHANGE COLUMN `name` `name` VARCHAR(254) NOT NULL AFTER `id_lang`;
ALTER TABLE `ps_cart_rule_product_rule`
	CHANGE COLUMN `type` `type` ENUM('products','categories','attributes','manufacturers','suppliers') NOT NULL AFTER `id_product_rule_group`;
ALTER TABLE `ps_category_lang`
	CHANGE COLUMN `name` `name` VARCHAR(128) NOT NULL AFTER `id_lang`,
	CHANGE COLUMN `description` `description` TEXT NULL AFTER `name`,
	CHANGE COLUMN `link_rewrite` `link_rewrite` VARCHAR(128) NOT NULL AFTER `description`,
	CHANGE COLUMN `meta_title` `meta_title` VARCHAR(128) NULL DEFAULT NULL AFTER `link_rewrite`,
	CHANGE COLUMN `meta_keywords` `meta_keywords` VARCHAR(255) NULL DEFAULT NULL AFTER `meta_title`,
	CHANGE COLUMN `meta_description` `meta_description` VARCHAR(255) NULL DEFAULT NULL AFTER `meta_keywords`;
ALTER TABLE `ps_cms_category_lang`
	CHANGE COLUMN `name` `name` VARCHAR(128) NOT NULL AFTER `id_shop`,
	CHANGE COLUMN `description` `description` TEXT NULL AFTER `name`,
	CHANGE COLUMN `link_rewrite` `link_rewrite` VARCHAR(128) NOT NULL AFTER `description`,
	CHANGE COLUMN `meta_title` `meta_title` VARCHAR(128) NULL DEFAULT NULL AFTER `link_rewrite`,
	CHANGE COLUMN `meta_keywords` `meta_keywords` VARCHAR(255) NULL DEFAULT NULL AFTER `meta_title`,
	CHANGE COLUMN `meta_description` `meta_description` VARCHAR(255) NULL DEFAULT NULL AFTER `meta_keywords`;
ALTER TABLE `ps_cms_lang`
	CHANGE COLUMN `meta_title` `meta_title` VARCHAR(128) NOT NULL AFTER `id_shop`,
	CHANGE COLUMN `meta_description` `meta_description` VARCHAR(255) NULL DEFAULT NULL AFTER `meta_title`,
	CHANGE COLUMN `meta_keywords` `meta_keywords` VARCHAR(255) NULL DEFAULT NULL AFTER `meta_description`,
	CHANGE COLUMN `content` `content` LONGTEXT NULL AFTER `meta_keywords`,
	CHANGE COLUMN `link_rewrite` `link_rewrite` VARCHAR(128) NOT NULL AFTER `content`;
ALTER TABLE `ps_cms_role_lang`
	CHANGE COLUMN `name` `name` VARCHAR(128) NULL DEFAULT NULL AFTER `id_shop`;
ALTER TABLE `ps_configuration_kpi_lang`
	CHANGE COLUMN `value` `value` TEXT NULL AFTER `id_lang`;
ALTER TABLE `ps_configuration_lang`
	CHANGE COLUMN `value` `value` TEXT NULL AFTER `id_lang`;
ALTER TABLE `ps_connections_source`
	CHANGE COLUMN `http_referer` `http_referer` VARCHAR(255) NULL DEFAULT NULL AFTER `id_connections`,
	CHANGE COLUMN `request_uri` `request_uri` VARCHAR(255) NULL DEFAULT NULL AFTER `http_referer`,
	CHANGE COLUMN `keywords` `keywords` VARCHAR(255) NULL DEFAULT NULL AFTER `request_uri`;
ALTER TABLE `ps_contact_lang`
	CHANGE COLUMN `name` `name` VARCHAR(64) NOT NULL AFTER `id_lang`,
	CHANGE COLUMN `description` `description` TEXT NULL AFTER `name`;
ALTER TABLE `ps_country_lang`
	CHANGE COLUMN `name` `name` VARCHAR(64) NOT NULL AFTER `id_lang`;
ALTER TABLE `ps_cronjobs`
	CHANGE COLUMN `description` `description` TEXT NULL AFTER `id_module`,
	CHANGE COLUMN `task` `task` TEXT NULL AFTER `description`;
ALTER TABLE `ps_customer`
	CHANGE COLUMN `company` `company` VARCHAR(64) NULL DEFAULT NULL AFTER `id_risk`,
	CHANGE COLUMN `siret` `siret` VARCHAR(14) NULL DEFAULT NULL AFTER `company`,
	CHANGE COLUMN `ape` `ape` VARCHAR(5) NULL DEFAULT NULL AFTER `siret`,
	CHANGE COLUMN `firstname` `firstname` VARCHAR(255) NOT NULL AFTER `ape`,
	CHANGE COLUMN `lastname` `lastname` VARCHAR(255) NOT NULL AFTER `firstname`,
	CHANGE COLUMN `email` `email` VARCHAR(128) NOT NULL AFTER `lastname`,
	CHANGE COLUMN `passwd` `passwd` VARCHAR(60) NOT NULL AFTER `email`,
	CHANGE COLUMN `ip_registration_newsletter` `ip_registration_newsletter` VARCHAR(15) NULL DEFAULT NULL AFTER `newsletter`,
	CHANGE COLUMN `website` `website` VARCHAR(128) NULL DEFAULT NULL AFTER `optin`,
	CHANGE COLUMN `secure_key` `secure_key` VARCHAR(32) NOT NULL DEFAULT '-1' AFTER `max_payment_days`,
	CHANGE COLUMN `note` `note` TEXT NULL AFTER `secure_key`,
	CHANGE COLUMN `reset_password_token` `reset_password_token` VARCHAR(40) NULL DEFAULT NULL AFTER `date_upd`;
ALTER TABLE `ps_customer_message`
	CHANGE COLUMN `message` `message` MEDIUMTEXT NOT NULL AFTER `id_employee`,
	CHANGE COLUMN `file_name` `file_name` VARCHAR(18) NULL DEFAULT NULL AFTER `message`,
	CHANGE COLUMN `ip_address` `ip_address` VARCHAR(16) NULL DEFAULT NULL AFTER `file_name`,
	CHANGE COLUMN `user_agent` `user_agent` VARCHAR(128) NULL DEFAULT NULL AFTER `ip_address`;
ALTER TABLE `ps_customer_thread`
	CHANGE COLUMN `status` `status` ENUM('open','closed','pending1','pending2') NOT NULL DEFAULT 'open' AFTER `id_e_ticket`,
	CHANGE COLUMN `email` `email` VARCHAR(128) NOT NULL AFTER `status`,
	CHANGE COLUMN `token` `token` VARCHAR(12) NULL DEFAULT NULL AFTER `email`;
ALTER TABLE `ps_customization_field_lang`
	CHANGE COLUMN `name` `name` VARCHAR(255) NOT NULL AFTER `id_shop`;
ALTER TABLE `ps_customized_data`
	CHANGE COLUMN `value` `value` VARCHAR(255) NOT NULL AFTER `index`;
ALTER TABLE `ps_emailsubscription`
	CHANGE COLUMN `email` `email` VARCHAR(255) NOT NULL AFTER `id_shop_group`,
	CHANGE COLUMN `ip_registration_newsletter` `ip_registration_newsletter` VARCHAR(15) NOT NULL AFTER `newsletter_date_add`,
	CHANGE COLUMN `http_referer` `http_referer` VARCHAR(255) NULL DEFAULT NULL AFTER `ip_registration_newsletter`;
ALTER TABLE `ps_feature_lang`
	CHANGE COLUMN `name` `name` VARCHAR(128) NULL DEFAULT NULL AFTER `id_lang`;
ALTER TABLE `ps_webservice_permission`
	CHANGE COLUMN `resource` `resource` VARCHAR(50) NOT NULL AFTER `id_webservice_permission`,
	CHANGE COLUMN `method` `method` ENUM('GET','POST','PUT','DELETE','HEAD') NOT NULL AFTER `resource`;
ALTER TABLE `ps_webservice_account`
	CHANGE COLUMN `key` `key` VARCHAR(32) NOT NULL AFTER `id_webservice_account`,
	CHANGE COLUMN `description` `description` TEXT NULL AFTER `key`,
	CHANGE COLUMN `class_name` `class_name` VARCHAR(50) NOT NULL DEFAULT 'WebserviceRequest' AFTER `is_module`,
	CHANGE COLUMN `module_name` `module_name` VARCHAR(50) NULL DEFAULT NULL AFTER `class_name`;
ALTER TABLE `ps_warehouse_product_location`
	CHANGE COLUMN `location` `location` VARCHAR(64) NULL DEFAULT NULL AFTER `id_warehouse`;
ALTER TABLE `ps_warehouse`
	CHANGE COLUMN `reference` `reference` VARCHAR(32) NULL DEFAULT NULL AFTER `id_employee`,
	CHANGE COLUMN `name` `name` VARCHAR(45) NOT NULL AFTER `reference`,
	CHANGE COLUMN `management_type` `management_type` ENUM('WA','FIFO','LIFO') NOT NULL DEFAULT 'WA' AFTER `name`;
ALTER TABLE `ps_translation`
	CHANGE COLUMN `key` `key` TEXT NOT NULL AFTER `id_lang`,
	CHANGE COLUMN `translation` `translation` TEXT NOT NULL AFTER `key`,
	CHANGE COLUMN `domain` `domain` VARCHAR(80) NOT NULL AFTER `translation`,
	CHANGE COLUMN `theme` `theme` VARCHAR(32) NULL DEFAULT NULL AFTER `domain`;
ALTER TABLE `ps_tax_lang`
	CHANGE COLUMN `name` `name` VARCHAR(32) NOT NULL AFTER `id_lang`;
ALTER TABLE `ps_tag`
	CHANGE COLUMN `name` `name` VARCHAR(32) NOT NULL AFTER `id_lang`;
ALTER TABLE `ps_tab_module_preference`
	CHANGE COLUMN `module` `module` VARCHAR(255) NOT NULL AFTER `id_tab`;
ALTER TABLE `ps_tab_lang`
	CHANGE COLUMN `name` `name` VARCHAR(128) NOT NULL AFTER `id_lang`;
ALTER TABLE `ps_tab`
	CHANGE COLUMN `module` `module` VARCHAR(64) NULL DEFAULT NULL AFTER `position`,
	CHANGE COLUMN `class_name` `class_name` VARCHAR(64) NULL DEFAULT NULL AFTER `module`,
	CHANGE COLUMN `icon` `icon` VARCHAR(32) NULL DEFAULT NULL AFTER `hide_host_mode`;
ALTER TABLE `ps_supply_order_state_lang`
	CHANGE COLUMN `name` `name` VARCHAR(128) NULL DEFAULT NULL AFTER `id_lang`;
ALTER TABLE `ps_supply_order_receipt_history`
	CHANGE COLUMN `employee_lastname` `employee_lastname` VARCHAR(32) NULL DEFAULT '' AFTER `id_employee`,
	CHANGE COLUMN `employee_firstname` `employee_firstname` VARCHAR(32) NULL DEFAULT '' AFTER `employee_lastname`;
ALTER TABLE `ps_supply_order_history`
	CHANGE COLUMN `employee_lastname` `employee_lastname` VARCHAR(32) NULL DEFAULT '' AFTER `id_employee`,
	CHANGE COLUMN `employee_firstname` `employee_firstname` VARCHAR(32) NULL DEFAULT '' AFTER `employee_lastname`;
ALTER TABLE `ps_supply_order_detail`
	CHANGE COLUMN `reference` `reference` VARCHAR(32) NOT NULL AFTER `id_product_attribute`,
	CHANGE COLUMN `supplier_reference` `supplier_reference` VARCHAR(32) NOT NULL AFTER `reference`,
	CHANGE COLUMN `name` `name` VARCHAR(128) NOT NULL AFTER `supplier_reference`,
	CHANGE COLUMN `ean13` `ean13` VARCHAR(13) NULL DEFAULT NULL AFTER `name`,
	CHANGE COLUMN `isbn` `isbn` VARCHAR(32) NULL DEFAULT NULL AFTER `ean13`,
	CHANGE COLUMN `upc` `upc` VARCHAR(12) NULL DEFAULT NULL AFTER `isbn`;
ALTER TABLE `ps_supply_order`
	CHANGE COLUMN `supplier_name` `supplier_name` VARCHAR(64) NOT NULL AFTER `id_supplier`,
	CHANGE COLUMN `reference` `reference` VARCHAR(64) NOT NULL AFTER `id_ref_currency`;
ALTER TABLE `ps_supplier_lang`
	CHANGE COLUMN `description` `description` TEXT NULL AFTER `id_lang`,
	CHANGE COLUMN `meta_title` `meta_title` VARCHAR(128) NULL DEFAULT NULL AFTER `description`,
	CHANGE COLUMN `meta_keywords` `meta_keywords` VARCHAR(255) NULL DEFAULT NULL AFTER `meta_title`,
	CHANGE COLUMN `meta_description` `meta_description` VARCHAR(255) NULL DEFAULT NULL AFTER `meta_keywords`;
ALTER TABLE `ps_supplier`
	CHANGE COLUMN `name` `name` VARCHAR(64) NOT NULL AFTER `id_supplier`;
ALTER TABLE `ps_store_lang`
	CHANGE COLUMN `name` `name` VARCHAR(255) NOT NULL AFTER `id_lang`,
	CHANGE COLUMN `address1` `address1` VARCHAR(255) NOT NULL AFTER `name`,
	CHANGE COLUMN `address2` `address2` VARCHAR(255) NULL DEFAULT NULL AFTER `address1`,
	CHANGE COLUMN `hours` `hours` TEXT NULL AFTER `address2`,
	CHANGE COLUMN `note` `note` TEXT NULL AFTER `hours`;
ALTER TABLE `ps_store`
	CHANGE COLUMN `city` `city` VARCHAR(64) NOT NULL AFTER `id_state`,
	CHANGE COLUMN `postcode` `postcode` VARCHAR(12) NOT NULL AFTER `city`,
	CHANGE COLUMN `phone` `phone` VARCHAR(16) NULL DEFAULT NULL AFTER `longitude`,
	CHANGE COLUMN `fax` `fax` VARCHAR(16) NULL DEFAULT NULL AFTER `phone`,
	CHANGE COLUMN `email` `email` VARCHAR(128) NULL DEFAULT NULL AFTER `fax`;
ALTER TABLE `ps_stock_mvt_reason_lang`
	CHANGE COLUMN `name` `name` VARCHAR(255) NOT NULL AFTER `id_lang`;
ALTER TABLE `ps_stock_mvt`
	CHANGE COLUMN `employee_lastname` `employee_lastname` VARCHAR(32) NULL DEFAULT NULL AFTER `id_employee`,
	CHANGE COLUMN `employee_firstname` `employee_firstname` VARCHAR(32) NULL DEFAULT NULL AFTER `employee_lastname`;
ALTER TABLE `ps_stock`
	CHANGE COLUMN `reference` `reference` VARCHAR(32) NOT NULL AFTER `id_product_attribute`,
	CHANGE COLUMN `ean13` `ean13` VARCHAR(13) NULL DEFAULT NULL AFTER `reference`,
	CHANGE COLUMN `isbn` `isbn` VARCHAR(32) NULL DEFAULT NULL AFTER `ean13`,
	CHANGE COLUMN `upc` `upc` VARCHAR(12) NULL DEFAULT NULL AFTER `isbn`;
ALTER TABLE `ps_statssearch`
	CHANGE COLUMN `keywords` `keywords` VARCHAR(255) NOT NULL AFTER `id_shop_group`;
ALTER TABLE `ps_specific_price_rule_condition`
	CHANGE COLUMN `type` `type` VARCHAR(255) NOT NULL AFTER `id_specific_price_rule_condition_group`,
	CHANGE COLUMN `value` `value` VARCHAR(255) NOT NULL AFTER `type`;
ALTER TABLE `ps_specific_price_rule`
	CHANGE COLUMN `name` `name` VARCHAR(255) NOT NULL AFTER `id_specific_price_rule`,
	CHANGE COLUMN `reduction_type` `reduction_type` ENUM('amount','percentage') NOT NULL AFTER `reduction_tax`;
ALTER TABLE `ps_specific_price_priority`
	CHANGE COLUMN `priority` `priority` VARCHAR(80) NOT NULL AFTER `id_product`;
ALTER TABLE `ps_specific_price`
	CHANGE COLUMN `reduction_type` `reduction_type` ENUM('amount','percentage') NOT NULL AFTER `reduction_tax`;
ALTER TABLE `ps_smarty_lazy_cache`
	CHANGE COLUMN `template_hash` `template_hash` VARCHAR(32) NOT NULL DEFAULT '' FIRST,
	CHANGE COLUMN `cache_id` `cache_id` VARCHAR(255) NOT NULL DEFAULT '' AFTER `template_hash`,
	CHANGE COLUMN `compile_id` `compile_id` VARCHAR(32) NOT NULL DEFAULT '' AFTER `cache_id`,
	CHANGE COLUMN `filepath` `filepath` VARCHAR(255) NOT NULL DEFAULT '' AFTER `compile_id`;
ALTER TABLE `ps_smarty_cache`
	CHANGE COLUMN `id_smarty_cache` `id_smarty_cache` CHAR(40) NOT NULL FIRST,
	CHANGE COLUMN `name` `name` CHAR(40) NOT NULL AFTER `id_smarty_cache`,
	CHANGE COLUMN `cache_id` `cache_id` VARCHAR(254) NULL DEFAULT NULL AFTER `name`,
	CHANGE COLUMN `content` `content` LONGTEXT NOT NULL AFTER `modified`;
ALTER TABLE `ps_shop_group`
	CHANGE COLUMN `name` `name` VARCHAR(64) NOT NULL AFTER `id_shop_group`;
ALTER TABLE `ps_shop`
	CHANGE COLUMN `name` `name` VARCHAR(64) NOT NULL AFTER `id_shop_group`,
	CHANGE COLUMN `theme_name` `theme_name` VARCHAR(255) NOT NULL AFTER `id_category`;
ALTER TABLE `ps_sekeyword`
	CHANGE COLUMN `keyword` `keyword` VARCHAR(256) NOT NULL AFTER `id_shop_group`;
ALTER TABLE `ps_search_word`
	CHANGE COLUMN `word` `word` VARCHAR(15) NOT NULL AFTER `id_lang`;
ALTER TABLE `ps_risk_lang`
	CHANGE COLUMN `name` `name` VARCHAR(20) NOT NULL AFTER `id_lang`;
ALTER TABLE `ps_required_field`
	CHANGE COLUMN `object_name` `object_name` VARCHAR(32) NOT NULL AFTER `id_required_field`,
	CHANGE COLUMN `field_name` `field_name` VARCHAR(32) NOT NULL AFTER `object_name`;
ALTER TABLE `ps_request_sql`
	CHANGE COLUMN `name` `name` VARCHAR(200) NOT NULL AFTER `id_request_sql`,
	CHANGE COLUMN `sql` `sql` TEXT NOT NULL AFTER `name`;
ALTER TABLE `ps_referrer`
	CHANGE COLUMN `name` `name` VARCHAR(64) NOT NULL AFTER `id_referrer`,
	CHANGE COLUMN `passwd` `passwd` VARCHAR(32) NULL DEFAULT NULL AFTER `name`,
	CHANGE COLUMN `http_referer_regexp` `http_referer_regexp` VARCHAR(64) NULL DEFAULT NULL AFTER `passwd`,
	CHANGE COLUMN `http_referer_like` `http_referer_like` VARCHAR(64) NULL DEFAULT NULL AFTER `http_referer_regexp`,
	CHANGE COLUMN `request_uri_regexp` `request_uri_regexp` VARCHAR(64) NULL DEFAULT NULL AFTER `http_referer_like`,
	CHANGE COLUMN `request_uri_like` `request_uri_like` VARCHAR(64) NULL DEFAULT NULL AFTER `request_uri_regexp`,
	CHANGE COLUMN `http_referer_regexp_not` `http_referer_regexp_not` VARCHAR(64) NULL DEFAULT NULL AFTER `request_uri_like`,
	CHANGE COLUMN `http_referer_like_not` `http_referer_like_not` VARCHAR(64) NULL DEFAULT NULL AFTER `http_referer_regexp_not`,
	CHANGE COLUMN `request_uri_regexp_not` `request_uri_regexp_not` VARCHAR(64) NULL DEFAULT NULL AFTER `http_referer_like_not`,
	CHANGE COLUMN `request_uri_like_not` `request_uri_like_not` VARCHAR(64) NULL DEFAULT NULL AFTER `request_uri_regexp_not`;
ALTER TABLE `ps_quick_access_lang`
	CHANGE COLUMN `name` `name` VARCHAR(32) NOT NULL AFTER `id_lang`;
ALTER TABLE `ps_profile_lang`
	CHANGE COLUMN `name` `name` VARCHAR(128) NOT NULL AFTER `id_profile`;
ALTER TABLE `ps_product_supplier`
	CHANGE COLUMN `product_supplier_reference` `product_supplier_reference` VARCHAR(32) NULL DEFAULT NULL AFTER `id_supplier`;
ALTER TABLE `ps_product_shop`
	CHANGE COLUMN `unity` `unity` VARCHAR(255) NULL DEFAULT NULL AFTER `wholesale_price`,
	CHANGE COLUMN `redirect_type` `redirect_type` ENUM('','404','301-product','302-product','301-category','302-category') NOT NULL DEFAULT '' AFTER `active`,
	CHANGE COLUMN `condition` `condition` ENUM('new','used','refurbished') NOT NULL DEFAULT 'new' AFTER `show_condition`,
	CHANGE COLUMN `visibility` `visibility` ENUM('both','catalog','search','none') NOT NULL DEFAULT 'both' AFTER `indexed`;
ALTER TABLE `ps_product_lang`
	CHANGE COLUMN `description` `description` TEXT NULL AFTER `id_lang`,
	CHANGE COLUMN `description_short` `description_short` TEXT NULL AFTER `description`,
	CHANGE COLUMN `link_rewrite` `link_rewrite` VARCHAR(128) NOT NULL AFTER `description_short`,
	CHANGE COLUMN `meta_description` `meta_description` VARCHAR(255) NULL DEFAULT NULL AFTER `link_rewrite`,
	CHANGE COLUMN `meta_keywords` `meta_keywords` VARCHAR(255) NULL DEFAULT NULL AFTER `meta_description`,
	CHANGE COLUMN `meta_title` `meta_title` VARCHAR(128) NULL DEFAULT NULL AFTER `meta_keywords`,
	CHANGE COLUMN `name` `name` VARCHAR(128) NOT NULL AFTER `meta_title`,
	CHANGE COLUMN `available_now` `available_now` VARCHAR(255) NULL DEFAULT NULL AFTER `name`,
	CHANGE COLUMN `available_later` `available_later` VARCHAR(255) NULL DEFAULT NULL AFTER `available_now`,
	CHANGE COLUMN `delivery_in_stock` `delivery_in_stock` VARCHAR(255) NULL DEFAULT NULL AFTER `available_later`,
	CHANGE COLUMN `delivery_out_stock` `delivery_out_stock` VARCHAR(255) NULL DEFAULT NULL AFTER `delivery_in_stock`;
ALTER TABLE `ps_product_download`
	CHANGE COLUMN `display_filename` `display_filename` VARCHAR(255) NULL DEFAULT NULL AFTER `id_product`,
	CHANGE COLUMN `filename` `filename` VARCHAR(255) NULL DEFAULT NULL AFTER `display_filename`;
ALTER TABLE `ps_product_attribute`
	CHANGE COLUMN `reference` `reference` VARCHAR(32) NULL DEFAULT NULL AFTER `id_product`,
	CHANGE COLUMN `supplier_reference` `supplier_reference` VARCHAR(32) NULL DEFAULT NULL AFTER `reference`,
	CHANGE COLUMN `location` `location` VARCHAR(64) NULL DEFAULT NULL AFTER `supplier_reference`,
	CHANGE COLUMN `ean13` `ean13` VARCHAR(13) NULL DEFAULT NULL AFTER `location`,
	CHANGE COLUMN `isbn` `isbn` VARCHAR(32) NULL DEFAULT NULL AFTER `ean13`,
	CHANGE COLUMN `upc` `upc` VARCHAR(12) NULL DEFAULT NULL AFTER `isbn`;
ALTER TABLE `ps_pagenotfound`
	CHANGE COLUMN `request_uri` `request_uri` VARCHAR(256) NOT NULL AFTER `id_shop_group`,
	CHANGE COLUMN `http_referer` `http_referer` VARCHAR(256) NOT NULL AFTER `request_uri`;
ALTER TABLE `ps_order_state_lang`
	CHANGE COLUMN `name` `name` VARCHAR(64) NOT NULL AFTER `id_lang`,
	CHANGE COLUMN `template` `template` VARCHAR(64) NOT NULL AFTER `name`;
ALTER TABLE `ps_order_slip`
	CHANGE COLUMN `description` `description` VARCHAR(255) NULL DEFAULT NULL AFTER `plici_id_order_slip`;
ALTER TABLE `ps_order_return_state_lang`
	CHANGE COLUMN `name` `name` VARCHAR(64) NOT NULL AFTER `id_lang`;
ALTER TABLE `ps_order_return`
	CHANGE COLUMN `question` `question` TEXT NOT NULL AFTER `state`;
ALTER TABLE `ps_order_payment`
	CHANGE COLUMN `order_reference` `order_reference` VARCHAR(10) NULL DEFAULT NULL AFTER `id_order_payment`,
	CHANGE COLUMN `payment_method` `payment_method` VARCHAR(255) NOT NULL AFTER `amount`,
	CHANGE COLUMN `transaction_id` `transaction_id` VARCHAR(254) NULL DEFAULT NULL AFTER `conversion_rate`,
	CHANGE COLUMN `card_number` `card_number` VARCHAR(254) NULL DEFAULT NULL AFTER `transaction_id`,
	CHANGE COLUMN `card_brand` `card_brand` VARCHAR(254) NULL DEFAULT NULL AFTER `card_number`,
	CHANGE COLUMN `card_expiration` `card_expiration` CHAR(7) NULL DEFAULT NULL AFTER `card_brand`,
	CHANGE COLUMN `card_holder` `card_holder` VARCHAR(254) NULL DEFAULT NULL AFTER `card_expiration`;
ALTER TABLE `ps_order_message_lang`
	CHANGE COLUMN `name` `name` VARCHAR(128) NOT NULL AFTER `id_lang`,
	CHANGE COLUMN `message` `message` TEXT NOT NULL AFTER `name`;
ALTER TABLE `ps_order_invoice_tax`
	CHANGE COLUMN `type` `type` VARCHAR(15) NOT NULL AFTER `id_order_invoice`;
ALTER TABLE `ps_order_invoice`
	CHANGE COLUMN `shop_address` `shop_address` TEXT NULL AFTER `total_wrapping_tax_incl`,
	CHANGE COLUMN `note` `note` TEXT NULL AFTER `shop_address`;
ALTER TABLE `ps_order_detail`
	CHANGE COLUMN `product_name` `product_name` VARCHAR(255) NOT NULL AFTER `id_customization`,
	CHANGE COLUMN `product_ean13` `product_ean13` VARCHAR(13) NULL DEFAULT NULL AFTER `product_quantity_discount`,
	CHANGE COLUMN `product_isbn` `product_isbn` VARCHAR(32) NULL DEFAULT NULL AFTER `product_ean13`,
	CHANGE COLUMN `product_upc` `product_upc` VARCHAR(12) NULL DEFAULT NULL AFTER `product_isbn`,
	CHANGE COLUMN `product_reference` `product_reference` VARCHAR(32) NULL DEFAULT NULL AFTER `product_upc`,
	CHANGE COLUMN `product_supplier_reference` `product_supplier_reference` VARCHAR(32) NULL DEFAULT NULL AFTER `product_reference`,
	CHANGE COLUMN `tax_name` `tax_name` VARCHAR(16) NOT NULL AFTER `tax_computation_method`,
	CHANGE COLUMN `download_hash` `download_hash` VARCHAR(255) NULL DEFAULT NULL AFTER `discount_quantity_applied`;
ALTER TABLE `ps_order_cart_rule`
	CHANGE COLUMN `name` `name` VARCHAR(254) NOT NULL AFTER `id_order_invoice`;
ALTER TABLE `ps_order_carrier`
	CHANGE COLUMN `tracking_number` `tracking_number` VARCHAR(64) NULL DEFAULT NULL AFTER `shipping_cost_tax_incl`;
ALTER TABLE `ps_orders`
	CHANGE COLUMN `reference` `reference` VARCHAR(10) NULL DEFAULT NULL AFTER `id_order`,
	CHANGE COLUMN `secure_key` `secure_key` VARCHAR(32) NOT NULL DEFAULT '-1' AFTER `current_state`,
	CHANGE COLUMN `payment` `payment` VARCHAR(255) NOT NULL AFTER `secure_key`,
	CHANGE COLUMN `module` `module` VARCHAR(255) NULL DEFAULT NULL AFTER `conversion_rate`,
	CHANGE COLUMN `gift_message` `gift_message` TEXT NULL AFTER `gift`,
	CHANGE COLUMN `shipping_number` `shipping_number` VARCHAR(64) NULL DEFAULT NULL AFTER `mobile_theme`,
	CHANGE COLUMN `e_recovery_mode_reference` `e_recovery_mode_reference` VARCHAR(45) NULL DEFAULT NULL AFTER `id_e_parcel`;
ALTER TABLE `ps_module_preference`
	CHANGE COLUMN `module` `module` VARCHAR(255) NOT NULL AFTER `id_employee`;
ALTER TABLE `ps_meta_lang`
	CHANGE COLUMN `title` `title` VARCHAR(128) NULL DEFAULT NULL AFTER `id_lang`,
	CHANGE COLUMN `description` `description` VARCHAR(255) NULL DEFAULT NULL AFTER `title`,
	CHANGE COLUMN `keywords` `keywords` VARCHAR(255) NULL DEFAULT NULL AFTER `description`,
	CHANGE COLUMN `url_rewrite` `url_rewrite` VARCHAR(254) NOT NULL AFTER `keywords`;
ALTER TABLE `ps_message`
	CHANGE COLUMN `message` `message` TEXT NOT NULL AFTER `id_order`;
ALTER TABLE `ps_memcached_servers`
	CHANGE COLUMN `ip` `ip` VARCHAR(254) NOT NULL AFTER `id_memcached_server`;
ALTER TABLE `ps_manufacturer_lang`
	CHANGE COLUMN `description` `description` TEXT NULL AFTER `id_lang`,
	CHANGE COLUMN `short_description` `short_description` TEXT NULL AFTER `description`,
	CHANGE COLUMN `meta_title` `meta_title` VARCHAR(128) NULL DEFAULT NULL AFTER `short_description`,
	CHANGE COLUMN `meta_keywords` `meta_keywords` VARCHAR(255) NULL DEFAULT NULL AFTER `meta_title`,
	CHANGE COLUMN `meta_description` `meta_description` VARCHAR(255) NULL DEFAULT NULL AFTER `meta_keywords`;
ALTER TABLE `ps_manufacturer`
	CHANGE COLUMN `name` `name` VARCHAR(64) NOT NULL AFTER `id_manufacturer`;
ALTER TABLE `ps_mail`
	CHANGE COLUMN `recipient` `recipient` VARCHAR(126) NOT NULL AFTER `id_mail`,
	CHANGE COLUMN `template` `template` VARCHAR(62) NOT NULL AFTER `recipient`,
	CHANGE COLUMN `subject` `subject` VARCHAR(254) NOT NULL AFTER `template`;
ALTER TABLE `ps_link_block_lang`
	CHANGE COLUMN `name` `name` VARCHAR(40) NOT NULL DEFAULT '' AFTER `id_lang`,
	CHANGE COLUMN `custom_content` `custom_content` TEXT NULL AFTER `name`;
ALTER TABLE `ps_linksmenutop_lang`
	CHANGE COLUMN `label` `label` VARCHAR(128) NOT NULL AFTER `id_shop`,
	CHANGE COLUMN `link` `link` VARCHAR(128) NOT NULL AFTER `label`;
ALTER TABLE `ps_layered_indexable_feature_value_lang_value`
	CHANGE COLUMN `url_name` `url_name` VARCHAR(128) NULL DEFAULT NULL AFTER `id_lang`,
	CHANGE COLUMN `meta_title` `meta_title` VARCHAR(128) NULL DEFAULT NULL AFTER `url_name`;
ALTER TABLE `ps_layered_indexable_feature_lang_value`
	CHANGE COLUMN `url_name` `url_name` VARCHAR(128) NOT NULL AFTER `id_lang`,
	CHANGE COLUMN `meta_title` `meta_title` VARCHAR(128) NULL DEFAULT NULL AFTER `url_name`;
ALTER TABLE `ps_layered_indexable_attribute_lang_value`
	CHANGE COLUMN `url_name` `url_name` VARCHAR(128) NULL DEFAULT NULL AFTER `id_lang`,
	CHANGE COLUMN `meta_title` `meta_title` VARCHAR(128) NULL DEFAULT NULL AFTER `url_name`;
ALTER TABLE `ps_layered_indexable_attribute_group_lang_value`
	CHANGE COLUMN `url_name` `url_name` VARCHAR(128) NULL DEFAULT NULL AFTER `id_lang`,
	CHANGE COLUMN `meta_title` `meta_title` VARCHAR(128) NULL DEFAULT NULL AFTER `url_name`;
ALTER TABLE `ps_layered_filter`
	CHANGE COLUMN `name` `name` VARCHAR(64) NOT NULL AFTER `id_layered_filter`,
	CHANGE COLUMN `filters` `filters` LONGTEXT NULL AFTER `name`;
ALTER TABLE `ps_layered_category`
	CHANGE COLUMN `type` `type` ENUM('category','id_feature','id_attribute_group','quantity','condition','manufacturer','weight','price') NOT NULL AFTER `id_value`;
ALTER TABLE `ps_lang`
	CHANGE COLUMN `name` `name` VARCHAR(32) NOT NULL AFTER `id_lang`,
	CHANGE COLUMN `iso_code` `iso_code` VARCHAR(2) NOT NULL AFTER `active`,
	CHANGE COLUMN `language_code` `language_code` VARCHAR(5) NOT NULL AFTER `iso_code`,
	CHANGE COLUMN `locale` `locale` VARCHAR(5) NOT NULL AFTER `language_code`,
	CHANGE COLUMN `date_format_lite` `date_format_lite` VARCHAR(32) NOT NULL AFTER `locale`,
	CHANGE COLUMN `date_format_full` `date_format_full` VARCHAR(32) NOT NULL AFTER `date_format_lite`;
ALTER TABLE `ps_info_lang`
	CHANGE COLUMN `text` `text` TEXT NOT NULL AFTER `id_lang`;
ALTER TABLE `ps_import_match`
	CHANGE COLUMN `name` `name` VARCHAR(32) NOT NULL AFTER `id_import_match`,
	CHANGE COLUMN `match` `match` TEXT NOT NULL AFTER `name`;
ALTER TABLE `ps_image_lang`
	CHANGE COLUMN `legend` `legend` VARCHAR(128) NULL DEFAULT NULL AFTER `id_lang`;
ALTER TABLE `ps_hook_module_exceptions`
	CHANGE COLUMN `file_name` `file_name` VARCHAR(255) NULL DEFAULT NULL AFTER `id_hook`;
ALTER TABLE `ps_homeslider_slides_lang`
	CHANGE COLUMN `title` `title` VARCHAR(255) NOT NULL AFTER `id_lang`,
	CHANGE COLUMN `description` `description` TEXT NOT NULL AFTER `title`,
	CHANGE COLUMN `legend` `legend` VARCHAR(255) NOT NULL AFTER `description`,
	CHANGE COLUMN `url` `url` VARCHAR(255) NOT NULL AFTER `legend`,
	CHANGE COLUMN `image` `image` VARCHAR(255) NOT NULL AFTER `url`;
ALTER TABLE `ps_group_lang`
	CHANGE COLUMN `name` `name` VARCHAR(32) NOT NULL AFTER `id_lang`;
ALTER TABLE `ps_gender_lang`
	CHANGE COLUMN `name` `name` VARCHAR(20) NOT NULL AFTER `id_lang`;
ALTER TABLE `ps_feature_value_lang`
	CHANGE COLUMN `value` `value` VARCHAR(255) NULL DEFAULT NULL AFTER `id_lang`;
ALTER TABLE `ps_address`
	CHANGE COLUMN `plici_object_type` `plici_object_type` VARCHAR(16) NOT NULL DEFAULT 'customer' AFTER `id_plici_object`,
	CHANGE COLUMN `alias` `alias` VARCHAR(32) NOT NULL AFTER `plici_object_type`,
	CHANGE COLUMN `company` `company` VARCHAR(255) NULL DEFAULT NULL AFTER `alias`,
	CHANGE COLUMN `lastname` `lastname` VARCHAR(255) NOT NULL AFTER `company`,
	CHANGE COLUMN `firstname` `firstname` VARCHAR(255) NOT NULL AFTER `lastname`,
	CHANGE COLUMN `address1` `address1` VARCHAR(128) NOT NULL AFTER `firstname`,
	CHANGE COLUMN `address2` `address2` VARCHAR(128) NULL DEFAULT NULL AFTER `address1`,
	CHANGE COLUMN `postcode` `postcode` VARCHAR(12) NULL DEFAULT NULL AFTER `address2`,
	CHANGE COLUMN `city` `city` VARCHAR(64) NOT NULL AFTER `postcode`,
	CHANGE COLUMN `other` `other` TEXT NULL AFTER `city`,
	CHANGE COLUMN `phone` `phone` VARCHAR(32) NULL DEFAULT NULL AFTER `other`,
	CHANGE COLUMN `phone_mobile` `phone_mobile` VARCHAR(32) NULL DEFAULT NULL AFTER `phone`,
	CHANGE COLUMN `vat_number` `vat_number` VARCHAR(32) NULL DEFAULT NULL AFTER `phone_mobile`,
	CHANGE COLUMN `dni` `dni` VARCHAR(16) NULL DEFAULT NULL AFTER `vat_number`;
ALTER TABLE `ps_address_format`
	CHANGE COLUMN `format` `format` VARCHAR(255) NOT NULL DEFAULT '' AFTER `id_country`;
ALTER TABLE `ps_admin_filter`
	CHANGE COLUMN `controller` `controller` VARCHAR(60) NOT NULL AFTER `shop`,
	CHANGE COLUMN `action` `action` VARCHAR(100) NOT NULL AFTER `controller`,
	CHANGE COLUMN `filter` `filter` LONGTEXT NOT NULL AFTER `action`;
ALTER TABLE `ps_advice_lang`
	CHANGE COLUMN `html` `html` TEXT NULL AFTER `id_lang`;
ALTER TABLE `ps_alias`
	CHANGE COLUMN `alias` `alias` VARCHAR(255) NOT NULL AFTER `id_alias`,
	CHANGE COLUMN `search` `search` VARCHAR(255) NOT NULL AFTER `alias`;
ALTER TABLE `ps_attachment`
	CHANGE COLUMN `file` `file` VARCHAR(40) NOT NULL AFTER `id_attachment`,
	CHANGE COLUMN `file_name` `file_name` VARCHAR(128) NOT NULL AFTER `file`,
	CHANGE COLUMN `mime` `mime` VARCHAR(128) NOT NULL AFTER `file_size`;
ALTER TABLE `ps_attachment_lang`
	CHANGE COLUMN `name` `name` VARCHAR(32) NULL DEFAULT NULL AFTER `id_lang`,
	CHANGE COLUMN `description` `description` TEXT NULL AFTER `name`;
ALTER TABLE `ps_attribute`
	CHANGE COLUMN `color` `color` VARCHAR(32) NOT NULL AFTER `id_attribute_group`;


Si vous aussi vous avez rencontrés des difficultés à diagnostiquer/corriger ou si vous avez des projets complexes, contactez nous afin d’en discuter.