rg701653 Posted January 6, 2012 Share Posted January 6, 2012 Bonjour, Je voulais savoir s'il existait un script sql ou du moins connaitre les requêtes SQL à effectuer pour créer un champ texte de personnalisation. Je n'ai absolument aucune idée de comment faire cela. Pourriez-vous m'aider ? Link to comment Share on other sites More sharing options...
rg701653 Posted January 6, 2012 Author Share Posted January 6, 2012 (edited) Bon bah comme d'hab, je galère un moment, je pose la question, je trouve la réponse. La voici (je préçise que c'est pour un champ texte) : INSERT INTO `ps_customization_field` (`id_product`, `type`, `required`) VALUES (X, 1, 0); UPDATE `ps_product` SET `customizable` = '1',`text_fields` = '1' WHERE `id_product` = X; /* A repeter pour chaque langue */ INSERT INTO `ps_customization_field_lang` (`id_customization_field`, `id_lang`, `name`) VALUES (Y, Z, 'VOTRE_TEXTE') ON DUPLICATE KEY UPDATE `name` = 'VOTRE_TEXTE'; /*****/ UPDATE `ps_customization_field` SET `required` = W WHERE `id_customization_field` = Y; Où : X : Id du produit Y : id de la ligne dans la table ps_customization_field Z : Id de la langue VOTRE_TEXTE : Le texte du champ à afficher W : Si le champs est requis ou non En espérant que cela serve à quelqu'un (surement moi le prochain coup). Guillaume Edited January 6, 2012 by rg701653 (see edit history) Link to comment Share on other sites More sharing options...
a-prods Posted April 6, 2012 Share Posted April 6, 2012 cool ! justement ce que je cherchait Merci Link to comment Share on other sites More sharing options...
poudalteam Posted February 4, 2014 Share Posted February 4, 2014 Bonsoir/Bonjour Je suis avec la version 1.5.5 et j'ai fait comme indiqué. mes lignes sont bien ajoutées dans les 2 tables de customization et l'update est bien fait dans la table produit ... Mais je ne vois rien dans le backoffice, tout est à zero. Vous avez une idée ? Avec oracle, je me serais dit qu'il faut faire un comit Link to comment Share on other sites More sharing options...
poudalteam Posted February 4, 2014 Share Posted February 4, 2014 Pour info, je supprime tout le catalogue avant de passer mon script d'import catalogue TRUNCATE TABLE ps_product; TRUNCATE TABLE ps_product_attachment; TRUNCATE TABLE ps_product_country_tax; TRUNCATE TABLE ps_product_group_reduction_cache; TRUNCATE TABLE ps_product_lang; TRUNCATE TABLE ps_product_sale; TRUNCATE TABLE ps_product_tag; TRUNCATE TABLE ps_category_product; TRUNCATE TABLE ps_compare_product; TRUNCATE TABLE ps_feature_product; TRUNCATE TABLE ps_search_index; TRUNCATE TABLE ps_specific_price; TRUNCATE TABLE ps_specific_price_priority; TRUNCATE TABLE ps_accessory; TRUNCATE TABLE ps_pack; TRUNCATE TABLE ps_attachment; TRUNCATE TABLE ps_attachment_lang; TRUNCATE TABLE ps_attribute; TRUNCATE TABLE ps_attribute_lang; TRUNCATE TABLE ps_attribute_group; TRUNCATE TABLE ps_attribute_group_lang; TRUNCATE TABLE ps_attribute_group_shop; TRUNCATE TABLE ps_attribute_impact; TRUNCATE TABLE ps_attribute_shop; TRUNCATE TABLE ps_feature; TRUNCATE TABLE ps_feature_lang; TRUNCATE TABLE ps_feature_value; TRUNCATE TABLE ps_feature_value_lang; TRUNCATE TABLE ps_customization_field; TRUNCATE TABLE ps_customization_field_lang; TRUNCATE TABLE ps_image; TRUNCATE TABLE ps_image_lang; TRUNCATE TABLE ps_image_shop; TRUNCATE TABLE ps_product_attribute; TRUNCATE TABLE ps_product_attribute_combination; TRUNCATE TABLE ps_product_attribute_image; TRUNCATE TABLE ps_product_attribute_shop; TRUNCATE TABLE ps_product_shop; TRUNCATE TABLE ps_product_supplier; TRUNCATE TABLE ps_product_download; TRUNCATE TABLE ps_search_word; TRUNCATE TABLE ps_cart; TRUNCATE TABLE ps_cart_product; TRUNCATE TABLE ps_customization; TRUNCATE TABLE ps_customized_data; TRUNCATE TABLE ps_scene; TRUNCATE TABLE ps_scene_category; TRUNCATE TABLE ps_scene_lang; TRUNCATE TABLE ps_scene_products; TRUNCATE TABLE ps_scene_shop; TRUNCATE TABLE ps_stock_mvt; TRUNCATE TABLE ps_manufacturer; TRUNCATE TABLE ps_manufacturer_lang; TRUNCATE TABLE ps_manufacturer_shop; TRUNCATE TABLE ps_supplier; TRUNCATE TABLE ps_supplier_lang; TRUNCATE TABLE ps_supplier_shop; TRUNCATE TABLE ps_tag; TRUNCATE TABLE ps_artefact_conversions_rules; TRUNCATE TABLE ps_artefact_orders_export; TRUNCATE TABLE ps_category; TRUNCATE TABLE ps_category_group; TRUNCATE TABLE ps_category_lang; TRUNCATE TABLE ps_category_product; TRUNCATE TABLE ps_category_shop; TRUNCATE TABLE ps_store; TRUNCATE TABLE ps_store_shop; Link to comment Share on other sites More sharing options...
poudalteam Posted February 4, 2014 Share Posted February 4, 2014 La solution : il ne faut pas oublier la table product_shop Db::getInstance()->Execute("UPDATE ps_product SET customizable = '1',text_fields = '5' WHERE id_product = $product_id"); Db::getInstance()->Execute("UPDATE ps_product_shop SET customizable = '1',text_fields = '5' WHERE id_product = $product_id"); Link to comment Share on other sites More sharing options...
akamaru Posted September 8, 2014 Share Posted September 8, 2014 bonjour, je suis sur prestashop 1.6 et je dois ajouter le champs personnalisation sur un grand nombre de produits,qu'elle est la meilleur solution. 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