{"id":2059,"date":"2019-11-18T14:19:03","date_gmt":"2019-11-18T12:19:03","guid":{"rendered":"https:\/\/www.h-hennes.fr\/blog\/?p=2059"},"modified":"2019-11-18T14:31:47","modified_gmt":"2019-11-18T12:31:47","slug":"prestashop-1-7-ajouter-un-champ-produit-de-type-file-dans-ladministration","status":"publish","type":"post","link":"https:\/\/www.h-hennes.fr\/blog\/2019\/11\/18\/prestashop-1-7-ajouter-un-champ-produit-de-type-file-dans-ladministration\/","title":{"rendered":"Prestashop 1.7 : Ajouter un champ produit de type file dans l&rsquo;administration"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Suite \u00e0 mon (ancien ) article <a href=\"https:\/\/www.h-hennes.fr\/blog\/2017\/10\/19\/prestashop-1-7-ajouter-des-champs-produit\/\">(https:\/\/www.h-hennes.fr\/blog\/2017\/10\/19\/prestashop-1-7-ajouter-des-champs-produit\/<\/a> ) sur l&rsquo;ajout de champs custom dans le formulaire d&rsquo;administration d&rsquo;un produit, j&rsquo;ai eut pas mal de questions sur comment ajouter un champ de type file.<\/p>\n\n\n\n<p>Il faut reconna\u00eetre que la fonctionnalit\u00e9 n&rsquo;est pas \u00e9vidente car le formulaire est soumis en ajax et le g\u00e8re pas l&rsquo;upload de fichiers.<\/p>\n<p>Le simple fait d&rsquo;ajouter un champ de type file dans le formulaire n&rsquo;est donc pas suffisant pour que cela fonctionne.<br><br>Cet article pr\u00e9sente une approche qui fonctionne, mais je ne peux pas garantir que c&rsquo;est la meilleure approche.<br><br>Pour son fonctionnement je me suis inspir\u00e9 de la gestion de l&rsquo;upload qui est faite pour la gestion des images standard du produit via la librairie Js <strong>Dropzone<\/strong><\/p>\n<p>Pour le code j&rsquo;ai donc repris le code de l&rsquo;ancien article en y ajoutant la logique d&rsquo;un champ image.<br><br>Voici visuellement comment se pr\u00e9sente le champ d&rsquo;upload<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"344\" height=\"237\" src=\"https:\/\/www.h-hennes.fr\/blog\/wp-content\/uploads\/2019\/11\/blog-input-file.png\" alt=\"\" class=\"wp-image-2060\" srcset=\"https:\/\/www.h-hennes.fr\/blog\/wp-content\/uploads\/2019\/11\/blog-input-file.png 344w, https:\/\/www.h-hennes.fr\/blog\/wp-content\/uploads\/2019\/11\/blog-input-file-300x207.png 300w\" sizes=\"auto, (max-width: 344px) 100vw, 344px\" \/><\/figure>\n\n\n\n<p>L&rsquo;ensemble de la logique d&rsquo;upload et de sauvegarde de la valeur du produit va \u00eatre g\u00e9r\u00e9e directement dans le module<\/p>\n<p>Voici le rendu dans le cas ou une image existe d\u00e9j\u00e0.<br>Il est possible de la supprimer en cliquant sur le lien correspondant<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"546\" height=\"595\" src=\"https:\/\/www.h-hennes.fr\/blog\/wp-content\/uploads\/2019\/11\/blog-input-file-exists-e1574076447618.png\" alt=\"\" class=\"wp-image-2061\" srcset=\"https:\/\/www.h-hennes.fr\/blog\/wp-content\/uploads\/2019\/11\/blog-input-file-exists-e1574076447618.png 546w, https:\/\/www.h-hennes.fr\/blog\/wp-content\/uploads\/2019\/11\/blog-input-file-exists-e1574076447618-275x300.png 275w\" sizes=\"auto, (max-width: 546px) 100vw, 546px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Voici le code pour l&rsquo;affichage et la gestion du champ dans le fichier tpl<br>Les commentaires devrait vous \u00e9clairer sur le fonctionnement, je l&rsquo;ai pens\u00e9 de mani\u00e8re \u00e0 pouvoir ajouter facilement plusieurs champs<\/p>\n\n\n\n<pre>\n{* Affichage du champ Image *}\n            &lt;div class=&quot;col-lg-12 col-xl-12&quot;&gt;\n                &lt;label class=&quot;form-control-label&quot;&gt;{l s='my custom field file' mod='hhproduct'}&lt;\/label&gt;\n\n                &lt;div id=&quot;custom_field_file_thumbnail&quot;&gt;\n                {* Si une image existe d&eacute;j&agrave; sur le produit *}\n                    {if isset($custom_field_file) &amp;&amp; $custom_field_file !=&quot;&quot;}\n                        &lt;div style=&quot;border: 1px dashed #000; padding:10px; max-width: 500px; margin-bottom: 30px; margin-top: 30px&quot; &gt;\n                            &lt;label class=&quot;form-control-label&quot;&gt;{l s='my current image' mod='hhproduct'}&lt;\/label&gt;&lt;br \/&gt;\n                        &lt;img src=&quot;{$file_dir}{$custom_field_file}&quot; style=&quot;max-width: 450px&quot; \/&gt;&lt;br \/&gt;\n                        &lt;a href=&quot;#&quot; class=&quot;custom_field_file_delete&quot;&gt;{l s='Delete this image' mod='hhproduct'}&lt;\/a&gt;\n                        &lt;\/div&gt;\n                {\/if}\n                &lt;\/div&gt;\n                &lt;input type=&quot;file&quot; class=&quot;dropzone&quot; name=&quot;custom_field_file_uploader&quot; id=&quot;custom_field_file_uploader&quot; \/&gt;\n            &lt;\/div&gt;\n                &lt;script&gt;\n                    $(function() {\n                        \/\/Gestion de l'upload via la librairie DropZone\n                        Dropzone.autoDiscover = false;\n                        var customFieldImageDropzone = $('#custom_field_file_uploader').dropzone({\n                            url: '{$moduleLink}&amp;id_product={$id_product}&amp;uploadProductImage=1&amp;field_name=custom_field_file',\n                            paramName: &quot;file&quot;, \/\/Nom du champs &agrave; envoyer\n                            previewTemplate : document.querySelector('#custom_field_file_dropzone_template').innerHTML,\n                            thumbnailWidth : 450,\n                            success : function(file){\n                                alert('{l s='File uploaded with success' mod='hhproduct'}');\n                                \/\/Affichage de la nouvelle image dans l'emplacement\n                                $('#custom_field_file_thumbnail').html('').html(file.previewElement);\n                            }\n                        });\n\n                        \/\/Gestion de la suppression\n                        $('#custom_field_file_thumbnail').on('click','.custom_field_file_delete',function(){\n                            $.ajax({\n                               method: 'post',\n                               url : '{$moduleLink}&amp;id_product={$id_product}&amp;deleteProductImage=1&amp;field_name=custom_field_file',\n                               success : function(msg){\n                                   console.log(msg);\n                                   alert('{l s='File delete with success' mod='hhproduct'}');\n                                   $('#custom_field_file_thumbnail').html('');\n                               }\n                            });\n                            return false;\n                        });\n                    });\n                &lt;\/script&gt;\n\n            {* template d'affichage dropzone *}\n            &lt;div id=&quot;custom_field_file_dropzone_template&quot; style=&quot;display:none&quot;&gt;\n                &lt;div style=&quot;border: 1px dashed #000; padding:10px; max-width: 500px; margin-bottom: 30px; margin-top: 30px&quot;&gt;\n                    &lt;div class=&quot;dz-details&quot;&gt;\n                        &lt;label class=&quot;form-control-label&quot;&gt;{l s='my new image' mod='hhproduct'}&lt;\/label&gt;&lt;br \/&gt;\n                        &lt;img data-dz-thumbnail style=&quot;max-width: 450px&quot; \/&gt;&lt;br \/&gt;\n                        &lt;a href=&quot;#&quot; class=&quot;custom_field_file_delete&quot;&gt;{l s='Delete this image' mod='hhproduct'}&lt;\/a&gt;\n                    &lt;\/div&gt;\n                &lt;\/div&gt;\n            &lt;\/div&gt;\n<\/pre>\n\n\n\n<p>Et voici le code php de gestion de cet upload<br \/>De mon c\u00f4t\u00e9 l&rsquo;objet product a \u00e9t\u00e9 surcharg\u00e9 pour ajouter ce champ mais libre \u00e0 vous de faire un traitement diff\u00e9rent<\/p>\n\n\n\n<pre lang=\"php\" escaped=\"true\">\n\/**\n     * Configuration admin du module\n     * @return string\n     * @throws PrestaShopDatabaseException\n     * @throws PrestaShopException\n     *\/\n    public function getContent()\n    {\n        \/\/Gestion de l'envoi des fichiers\n        if (Tools::getValue('uploadProductImage')) {\n            $id_product = (int)Tools::getValue('id_product');\n            $field_name = Tools::getValue('field_name');\n            if ($this->_updateProductImageField($id_product, $field_name)) {\n                return $this->l('Image uploaded with success');\n            }\n        } elseif (Tools::getValue('deleteProductImage')) {\n            $id_product = (int)Tools::getValue('id_product');\n            $field_name = Tools::getValue('field_name');\n            if ($this->_deleteProductImageField($id_product, $field_name)) {\n                return $this->l('Image deleted with success');\n            }\n        } else {\n            return 'No configuration needed for this module';\n        }\n\n    }\n\n    \/**\n     * Upload de l'image d'un produit\n     * @param $id_product\n     * @param $field_name\n     * @return bool\n     * @throws PrestaShopDatabaseException\n     * @throws PrestaShopException\n     *\/\n    protected function _updateProductImageField($id_product, $field_name)\n    {\n        \/\/Envoi de l'image\n        \/\/@TOdo g\u00e9rer le cas ou l'image existe d\u00e9j\u00e0\n        $savePath = dirname(__FILE__) . '\/views\/img\/p';\n        $uploader = new Uploader('file');\n        $file = $uploader->setSavePath($savePath)\n            ->setAcceptTypes(['jpg', 'png', 'git', 'jpeg'])\n            ->process();\n\n        $fileName = ltrim(str_replace($savePath, '', $file[0]['save_path']), '\/');\n        try {\n            \/\/Sauvegarde la valeur de l'image pour le produit\n            $product = new Product($id_product);\n            $product->$field_name = $fileName;\n            $product->save();\n        } catch (PrestaShopException $e) {\n            echo $e->getMessage();\n            return false;\n        }\n\n        return true;\n    }\n\n\n    \/**\n     * Suppression de l'image d'un produit\n     * @param $id_product\n     * @param $field_name\n     * @return bool\n     *\/\n    protected function _deleteProductImageField($id_product, $field_name)\n    {\n        try {\n            \/\/Sauvegarde d'une valeur vide pour le produit\n            $product = new Product($id_product);\n\n\n            \/\/Si le produit a une image et qu'elle existe on la supprime\n            if ($product->$field_name != \"\") {\n                $imagePath = dirname(__FILE__) . '\/views\/img\/p\/' . $product->$field_name;\n                if (is_file($imagePath)) {\n                    unlink($imagePath);\n                }\n            }\n            $product->$field_name = '';\n            $product->save();\n        } catch (PrestaShopException $e) {\n            echo $e->getMessage();\n            return false;\n        }\n    }\n<\/pre>\n\n\n\n<p>Vous pouvez t\u00e9l\u00e9charger ci-dessous une version du module qui impl\u00e9mente ce champ (je l&rsquo;ai test\u00e9 uniquement sur Ps 1.7.6 )<\/p>\n<p>\u00a0<\/p>\n\n\n\n<div class=\"wp-block-file\"><a href=\"https:\/\/www.h-hennes.fr\/blog\/wp-content\/uploads\/2019\/11\/hhproduct.zip\">hhproduct<\/a><a href=\"https:\/\/www.h-hennes.fr\/blog\/wp-content\/uploads\/2019\/11\/hhproduct.zip\" class=\"wp-block-file__button\" download>T\u00e9l\u00e9charger<\/a><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Suite \u00e0 mon (ancien ) article (https:\/\/www.h-hennes.fr\/blog\/2017\/10\/19\/prestashop-1-7-ajouter-des-champs-produit\/ ) sur l&rsquo;ajout de champs custom dans le formulaire d&rsquo;administration d&rsquo;un produit, j&rsquo;ai eut pas mal de questions sur comment ajouter un champ de type file. Il faut reconna\u00eetre que la fonctionnalit\u00e9 n&rsquo;est pas \u00e9vidente car le formulaire est soumis en ajax et le g\u00e8re pas l&rsquo;upload de [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[245],"tags":[512,551,483,550],"class_list":["post-2059","post","type-post","status-publish","format-standard","hentry","category-prestashop-2","tag-administration","tag-file","tag-prestashop-1-7","tag-product"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 5.0.1.1 - aioseo.com -->\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"herve\"\/>\n\t<link rel=\"canonical\" href=\"https:\/\/www.h-hennes.fr\/blog\/2019\/11\/18\/prestashop-1-7-ajouter-un-champ-produit-de-type-file-dans-ladministration\/\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 5.0.1.1\" \/>\n\t\t<script type=\"application\/ld+json\" class=\"aioseo-schema\">\n\t\t\t{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.h-hennes.fr\\\/blog\\\/2019\\\/11\\\/18\\\/prestashop-1-7-ajouter-un-champ-produit-de-type-file-dans-ladministration\\\/#article\",\"name\":\"Prestashop 1.7 : Ajouter un champ produit de type file dans l\\u2019administration | Herv\\u00e9 Hennes\",\"headline\":\"Prestashop 1.7 : Ajouter un champ produit de type file dans l&rsquo;administration\",\"author\":{\"@id\":\"https:\\\/\\\/www.h-hennes.fr\\\/blog\\\/author\\\/herve\\\/#author\"},\"publisher\":{\"@id\":\"https:\\\/\\\/www.h-hennes.fr\\\/blog\\\/#organization\"},\"image\":{\"@type\":\"ImageObject\",\"url\":\"https:\\\/\\\/www.h-hennes.fr\\\/blog\\\/wp-content\\\/uploads\\\/2019\\\/11\\\/blog-input-file.png\",\"@id\":\"https:\\\/\\\/www.h-hennes.fr\\\/blog\\\/2019\\\/11\\\/18\\\/prestashop-1-7-ajouter-un-champ-produit-de-type-file-dans-ladministration\\\/#articleImage\",\"width\":344,\"height\":237},\"datePublished\":\"2019-11-18T14:19:03+02:00\",\"dateModified\":\"2019-11-18T14:31:47+02:00\",\"inLanguage\":\"fr-FR\",\"commentCount\":3,\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.h-hennes.fr\\\/blog\\\/2019\\\/11\\\/18\\\/prestashop-1-7-ajouter-un-champ-produit-de-type-file-dans-ladministration\\\/#webpage\"},\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.h-hennes.fr\\\/blog\\\/2019\\\/11\\\/18\\\/prestashop-1-7-ajouter-un-champ-produit-de-type-file-dans-ladministration\\\/#webpage\"},\"articleSection\":\"Prestashop, administration, file, prestashop 1.7, product\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.h-hennes.fr\\\/blog\\\/2019\\\/11\\\/18\\\/prestashop-1-7-ajouter-un-champ-produit-de-type-file-dans-ladministration\\\/#breadcrumblist\",\"itemListElement\":[{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.h-hennes.fr\\\/blog#listItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.h-hennes.fr\\\/blog\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.h-hennes.fr\\\/blog\\\/category\\\/prestashop-2\\\/#listItem\",\"name\":\"Prestashop\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.h-hennes.fr\\\/blog\\\/category\\\/prestashop-2\\\/#listItem\",\"position\":2,\"name\":\"Prestashop\",\"item\":\"https:\\\/\\\/www.h-hennes.fr\\\/blog\\\/category\\\/prestashop-2\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.h-hennes.fr\\\/blog\\\/2019\\\/11\\\/18\\\/prestashop-1-7-ajouter-un-champ-produit-de-type-file-dans-ladministration\\\/#listItem\",\"name\":\"Prestashop 1.7 : Ajouter un champ produit de type file dans l&rsquo;administration\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.h-hennes.fr\\\/blog#listItem\",\"name\":\"Home\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.h-hennes.fr\\\/blog\\\/2019\\\/11\\\/18\\\/prestashop-1-7-ajouter-un-champ-produit-de-type-file-dans-ladministration\\\/#listItem\",\"position\":3,\"name\":\"Prestashop 1.7 : Ajouter un champ produit de type file dans l&rsquo;administration\",\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.h-hennes.fr\\\/blog\\\/category\\\/prestashop-2\\\/#listItem\",\"name\":\"Prestashop\"}}]},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.h-hennes.fr\\\/blog\\\/#organization\",\"name\":\"Herv\\u00e9 Hennes\",\"description\":\"D\\u00e9veloppeur e-commerce\",\"url\":\"https:\\\/\\\/www.h-hennes.fr\\\/blog\\\/\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.h-hennes.fr\\\/blog\\\/author\\\/herve\\\/#author\",\"url\":\"https:\\\/\\\/www.h-hennes.fr\\\/blog\\\/author\\\/herve\\\/\",\"name\":\"herve\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\\\/\\\/www.h-hennes.fr\\\/blog\\\/2019\\\/11\\\/18\\\/prestashop-1-7-ajouter-un-champ-produit-de-type-file-dans-ladministration\\\/#authorImage\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/248532c833c69e304668cc20fd20ec6ddc1808306f57d5d14e632059f50347a4?s=96&d=mm&r=g\",\"width\":96,\"height\":96,\"caption\":\"herve\"}},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.h-hennes.fr\\\/blog\\\/2019\\\/11\\\/18\\\/prestashop-1-7-ajouter-un-champ-produit-de-type-file-dans-ladministration\\\/#webpage\",\"url\":\"https:\\\/\\\/www.h-hennes.fr\\\/blog\\\/2019\\\/11\\\/18\\\/prestashop-1-7-ajouter-un-champ-produit-de-type-file-dans-ladministration\\\/\",\"name\":\"Prestashop 1.7 : Ajouter un champ produit de type file dans l\\u2019administration | Herv\\u00e9 Hennes\",\"inLanguage\":\"fr-FR\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.h-hennes.fr\\\/blog\\\/#website\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.h-hennes.fr\\\/blog\\\/2019\\\/11\\\/18\\\/prestashop-1-7-ajouter-un-champ-produit-de-type-file-dans-ladministration\\\/#breadcrumblist\"},\"author\":{\"@id\":\"https:\\\/\\\/www.h-hennes.fr\\\/blog\\\/author\\\/herve\\\/#author\"},\"creator\":{\"@id\":\"https:\\\/\\\/www.h-hennes.fr\\\/blog\\\/author\\\/herve\\\/#author\"},\"datePublished\":\"2019-11-18T14:19:03+02:00\",\"dateModified\":\"2019-11-18T14:31:47+02:00\"},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.h-hennes.fr\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.h-hennes.fr\\\/blog\\\/\",\"name\":\"Herv\\u00e9 Hennes\",\"description\":\"D\\u00e9veloppeur e-commerce\",\"inLanguage\":\"fr-FR\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.h-hennes.fr\\\/blog\\\/#organization\"}}]}\n\t\t<\/script>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"Prestashop 1.7 : Ajouter un champ produit de type file dans l\u2019administration | Herv\u00e9 Hennes","description":"","canonical_url":"https:\/\/www.h-hennes.fr\/blog\/2019\/11\/18\/prestashop-1-7-ajouter-un-champ-produit-de-type-file-dans-ladministration\/","robots":"max-image-preview:large","keywords":"","webmasterTools":{"miscellaneous":""},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.h-hennes.fr\/blog\/2019\/11\/18\/prestashop-1-7-ajouter-un-champ-produit-de-type-file-dans-ladministration\/#article","name":"Prestashop 1.7 : Ajouter un champ produit de type file dans l\u2019administration | Herv\u00e9 Hennes","headline":"Prestashop 1.7 : Ajouter un champ produit de type file dans l&rsquo;administration","author":{"@id":"https:\/\/www.h-hennes.fr\/blog\/author\/herve\/#author"},"publisher":{"@id":"https:\/\/www.h-hennes.fr\/blog\/#organization"},"image":{"@type":"ImageObject","url":"https:\/\/www.h-hennes.fr\/blog\/wp-content\/uploads\/2019\/11\/blog-input-file.png","@id":"https:\/\/www.h-hennes.fr\/blog\/2019\/11\/18\/prestashop-1-7-ajouter-un-champ-produit-de-type-file-dans-ladministration\/#articleImage","width":344,"height":237},"datePublished":"2019-11-18T14:19:03+02:00","dateModified":"2019-11-18T14:31:47+02:00","inLanguage":"fr-FR","commentCount":3,"mainEntityOfPage":{"@id":"https:\/\/www.h-hennes.fr\/blog\/2019\/11\/18\/prestashop-1-7-ajouter-un-champ-produit-de-type-file-dans-ladministration\/#webpage"},"isPartOf":{"@id":"https:\/\/www.h-hennes.fr\/blog\/2019\/11\/18\/prestashop-1-7-ajouter-un-champ-produit-de-type-file-dans-ladministration\/#webpage"},"articleSection":"Prestashop, administration, file, prestashop 1.7, product"},{"@type":"BreadcrumbList","@id":"https:\/\/www.h-hennes.fr\/blog\/2019\/11\/18\/prestashop-1-7-ajouter-un-champ-produit-de-type-file-dans-ladministration\/#breadcrumblist","itemListElement":[{"@type":"ListItem","@id":"https:\/\/www.h-hennes.fr\/blog#listItem","position":1,"name":"Home","item":"https:\/\/www.h-hennes.fr\/blog","nextItem":{"@type":"ListItem","@id":"https:\/\/www.h-hennes.fr\/blog\/category\/prestashop-2\/#listItem","name":"Prestashop"}},{"@type":"ListItem","@id":"https:\/\/www.h-hennes.fr\/blog\/category\/prestashop-2\/#listItem","position":2,"name":"Prestashop","item":"https:\/\/www.h-hennes.fr\/blog\/category\/prestashop-2\/","nextItem":{"@type":"ListItem","@id":"https:\/\/www.h-hennes.fr\/blog\/2019\/11\/18\/prestashop-1-7-ajouter-un-champ-produit-de-type-file-dans-ladministration\/#listItem","name":"Prestashop 1.7 : Ajouter un champ produit de type file dans l&rsquo;administration"},"previousItem":{"@type":"ListItem","@id":"https:\/\/www.h-hennes.fr\/blog#listItem","name":"Home"}},{"@type":"ListItem","@id":"https:\/\/www.h-hennes.fr\/blog\/2019\/11\/18\/prestashop-1-7-ajouter-un-champ-produit-de-type-file-dans-ladministration\/#listItem","position":3,"name":"Prestashop 1.7 : Ajouter un champ produit de type file dans l&rsquo;administration","previousItem":{"@type":"ListItem","@id":"https:\/\/www.h-hennes.fr\/blog\/category\/prestashop-2\/#listItem","name":"Prestashop"}}]},{"@type":"Organization","@id":"https:\/\/www.h-hennes.fr\/blog\/#organization","name":"Herv\u00e9 Hennes","description":"D\u00e9veloppeur e-commerce","url":"https:\/\/www.h-hennes.fr\/blog\/"},{"@type":"Person","@id":"https:\/\/www.h-hennes.fr\/blog\/author\/herve\/#author","url":"https:\/\/www.h-hennes.fr\/blog\/author\/herve\/","name":"herve","image":{"@type":"ImageObject","@id":"https:\/\/www.h-hennes.fr\/blog\/2019\/11\/18\/prestashop-1-7-ajouter-un-champ-produit-de-type-file-dans-ladministration\/#authorImage","url":"https:\/\/secure.gravatar.com\/avatar\/248532c833c69e304668cc20fd20ec6ddc1808306f57d5d14e632059f50347a4?s=96&d=mm&r=g","width":96,"height":96,"caption":"herve"}},{"@type":"WebPage","@id":"https:\/\/www.h-hennes.fr\/blog\/2019\/11\/18\/prestashop-1-7-ajouter-un-champ-produit-de-type-file-dans-ladministration\/#webpage","url":"https:\/\/www.h-hennes.fr\/blog\/2019\/11\/18\/prestashop-1-7-ajouter-un-champ-produit-de-type-file-dans-ladministration\/","name":"Prestashop 1.7 : Ajouter un champ produit de type file dans l\u2019administration | Herv\u00e9 Hennes","inLanguage":"fr-FR","isPartOf":{"@id":"https:\/\/www.h-hennes.fr\/blog\/#website"},"breadcrumb":{"@id":"https:\/\/www.h-hennes.fr\/blog\/2019\/11\/18\/prestashop-1-7-ajouter-un-champ-produit-de-type-file-dans-ladministration\/#breadcrumblist"},"author":{"@id":"https:\/\/www.h-hennes.fr\/blog\/author\/herve\/#author"},"creator":{"@id":"https:\/\/www.h-hennes.fr\/blog\/author\/herve\/#author"},"datePublished":"2019-11-18T14:19:03+02:00","dateModified":"2019-11-18T14:31:47+02:00"},{"@type":"WebSite","@id":"https:\/\/www.h-hennes.fr\/blog\/#website","url":"https:\/\/www.h-hennes.fr\/blog\/","name":"Herv\u00e9 Hennes","description":"D\u00e9veloppeur e-commerce","inLanguage":"fr-FR","publisher":{"@id":"https:\/\/www.h-hennes.fr\/blog\/#organization"}}]}},"aioseo_meta_data":{"post_id":"2059","title":null,"description":null,"keywords":null,"keyphrases":null,"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":null,"og_custom_url":null,"og_article_section":null,"og_article_tags":null,"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"","isEnabled":true},"graphs":[]},"schema_type":null,"schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":null,"robots_max_videopreview":null,"robots_max_imagepreview":"large","priority":null,"frequency":null,"local_seo":null,"breadcrumb_settings":null,"limit_modified_date":false,"ai":null,"created":"2020-12-29 16:37:17","updated":"2022-10-01 14:32:37","seo_analyzer_scan_date":null,"focus_keyword":null,"additional_keywords":null,"truseo_locale":null},"aioseo_breadcrumb":"<div class=\"aioseo-breadcrumbs\"><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/www.h-hennes.fr\/blog\" title=\"Home\">Home<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/www.h-hennes.fr\/blog\/category\/prestashop-2\/\" title=\"Prestashop\">Prestashop<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\tPrestashop 1.7 : Ajouter un champ produit de type file dans l\u2019administration\n\t\t<\/span><\/div>","aioseo_breadcrumb_json":[{"label":"Home","link":"https:\/\/www.h-hennes.fr\/blog"},{"label":"Prestashop","link":"https:\/\/www.h-hennes.fr\/blog\/category\/prestashop-2\/"},{"label":"Prestashop 1.7 : Ajouter un champ produit de type file dans l&rsquo;administration","link":"https:\/\/www.h-hennes.fr\/blog\/2019\/11\/18\/prestashop-1-7-ajouter-un-champ-produit-de-type-file-dans-ladministration\/"}],"_links":{"self":[{"href":"https:\/\/www.h-hennes.fr\/blog\/wp-json\/wp\/v2\/posts\/2059","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.h-hennes.fr\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.h-hennes.fr\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.h-hennes.fr\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.h-hennes.fr\/blog\/wp-json\/wp\/v2\/comments?post=2059"}],"version-history":[{"count":4,"href":"https:\/\/www.h-hennes.fr\/blog\/wp-json\/wp\/v2\/posts\/2059\/revisions"}],"predecessor-version":[{"id":2068,"href":"https:\/\/www.h-hennes.fr\/blog\/wp-json\/wp\/v2\/posts\/2059\/revisions\/2068"}],"wp:attachment":[{"href":"https:\/\/www.h-hennes.fr\/blog\/wp-json\/wp\/v2\/media?parent=2059"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.h-hennes.fr\/blog\/wp-json\/wp\/v2\/categories?post=2059"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.h-hennes.fr\/blog\/wp-json\/wp\/v2\/tags?post=2059"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}