{"id":514,"date":"2013-10-15T15:50:01","date_gmt":"2013-10-15T13:50:01","guid":{"rendered":"http:\/\/www.h-hennes.fr\/blog\/?p=514"},"modified":"2013-10-15T15:51:27","modified_gmt":"2013-10-15T13:51:27","slug":"prestashop-bouton-dimpression-pour-les-images-dans-fancybox","status":"publish","type":"post","link":"https:\/\/www.h-hennes.fr\/blog\/2013\/10\/15\/prestashop-bouton-dimpression-pour-les-images-dans-fancybox\/","title":{"rendered":"Prestashop : Bouton d&rsquo;impression pour les images avec fancybox"},"content":{"rendered":"<p>Voici un petit tips pour rajouter facilement un bouton d&rsquo;impression pour prestashop dans la popin fancyBox <span style=\"text-decoration: underline;\">sans toucher au code source du plugin<\/span><\/p>\n<p>&nbsp;<\/p>\n<p>Dans le fichier <strong>\/themes\/<em>yourtheme<\/em>\/product.css<\/strong><\/p>\n<pre lang=\"css\" line=\"1\" escaped=\"true\">#fancybox-print-item {\r\n  width:50px;\r\n  height:44px;\r\n  background-image:url('..\/img\/print-sheet.png');\r\n  background-repeat:no-repeat;\r\n  float:right;\r\n  position:relative;\r\n  margin-top:-44px;\r\n  margin-right:4px;\r\n  z-index:1103;\r\n}\r\n#fancybox-print-item a{ \r\n   width:50px;\r\n   height:44px;\r\n   display:block;\r\n}<\/pre>\n<p>Dans le fichier <strong>themes\/<em>yourtheme<\/em>\/product.js<\/strong><\/p>\n<pre lang=\"javascript\" line=\"1\" escaped=\"true\">\/\/Ajout d'une fonction d'impression \u00e0 fancyBox\r\n$('#fancybox-close').before('&lt;div id=\"fancybox-print-item\"&gt;&lt;a href=\"#\"&gt;&amp;nbsp;&lt;\/a&gt;&lt;\/div&gt;');\r\n\r\n\/\/Gestion du click pour l'impression\r\n$('#fancybox-print-item').live('click',function(){\r\nprintIt($('#fancybox-content').html());\r\nreturn false;\r\n});\r\n\r\n\/\/Gestion de l'impression des images produits\r\n\/\/ cf. http:\/\/www.thatagency.com\/design-studio-blog\/2010\/04\/add-print-ability-to-fancybox-jquery-plugin\r\nvar win=null;\r\nfunction printIt(printThis) {\r\nwin = window.open();\r\nself.focus();\r\nwin.document.open();\r\nwin.document.write('');\r\nwin.document.write(printThis);\r\nwin.document.write('');\r\nwin.document.close();\r\nwin.print();\r\nwin.close();\r\n}<\/pre>\n<p>Voici un exemple du rendu :<\/p>\n<p><a href=\"https:\/\/www.h-hennes.fr\/blog\/wp-content\/uploads\/2013\/10\/fancybox.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-516\" alt=\"fancybox\" src=\"https:\/\/www.h-hennes.fr\/blog\/wp-content\/uploads\/2013\/10\/fancybox.png\" width=\"490\" height=\"498\" srcset=\"https:\/\/www.h-hennes.fr\/blog\/wp-content\/uploads\/2013\/10\/fancybox.png 490w, https:\/\/www.h-hennes.fr\/blog\/wp-content\/uploads\/2013\/10\/fancybox-295x300.png 295w\" sizes=\"auto, (max-width: 490px) 100vw, 490px\" \/><\/a><\/p>\n<p>Si vous souhaitez r\u00e9cup\u00e9rer l&rsquo;image c&rsquo;est par ici : <a title=\"Icone imprimer fancybox\" href=\"https:\/\/www.h-hennes.fr\/blog\/wp-content\/uploads\/2013\/10\/print-sheet.png\">https:\/\/www.h-hennes.fr\/blog\/wp-content\/uploads\/2013\/10\/print-sheet.png<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Voici un petit tips pour rajouter facilement un bouton d&rsquo;impression pour prestashop dans la popin fancyBox sans toucher au code source du plugin &nbsp; Dans le fichier \/themes\/yourtheme\/product.css #fancybox-print-item { width:50px; height:44px; background-image:url(&lsquo;..\/img\/print-sheet.png&rsquo;); background-repeat:no-repeat; float:right; position:relative; margin-top:-44px; margin-right:4px; z-index:1103; } #fancybox-print-item a{ width:50px; height:44px; display:block; } Dans le fichier themes\/yourtheme\/product.js \/\/Ajout d&rsquo;une fonction d&rsquo;impression \u00e0 [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","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,6],"tags":[252,253,104],"class_list":["post-514","post","type-post","status-publish","format-standard","hentry","category-prestashop-2","category-trucs-et-astuces","tag-fancybox","tag-impression-fancybox","tag-prestashop"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.h-hennes.fr\/blog\/wp-json\/wp\/v2\/posts\/514","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=514"}],"version-history":[{"count":6,"href":"https:\/\/www.h-hennes.fr\/blog\/wp-json\/wp\/v2\/posts\/514\/revisions"}],"predecessor-version":[{"id":522,"href":"https:\/\/www.h-hennes.fr\/blog\/wp-json\/wp\/v2\/posts\/514\/revisions\/522"}],"wp:attachment":[{"href":"https:\/\/www.h-hennes.fr\/blog\/wp-json\/wp\/v2\/media?parent=514"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.h-hennes.fr\/blog\/wp-json\/wp\/v2\/categories?post=514"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.h-hennes.fr\/blog\/wp-json\/wp\/v2\/tags?post=514"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}