{"id":10339,"date":"2021-12-30T21:19:26","date_gmt":"2021-12-30T20:19:26","guid":{"rendered":"https:\/\/www.welaunch.io\/en\/my-tickets\/ticket\/are-custom-layouts-possible\/"},"modified":"2023-06-07T08:03:03","modified_gmt":"2023-06-07T06:03:03","slug":"are-custom-layouts-possible","status":"publish","type":"faq","link":"https:\/\/www.welaunch.io\/en\/knowledge-base\/faq\/are-custom-layouts-possible\/","title":{"rendered":"Are custom PDF layouts possible?"},"content":{"rendered":"<p>If none of the built in PDF layouts are what you are looking for then there are two solutions for your own custom PDF template.<\/p>\n<h2>First option: <strong>code your own template in PHP<\/strong>.<\/h2>\n<p><strong>Print products PDF<\/strong><\/p>\n<p>Therefore you can use one of the two filters:<\/p>\n<ol>\n<li>woocommerce_print_products_product_html<\/li>\n<li>woocommerce_print_products_product_final_html<\/li>\n<\/ol>\n<p><strong>Print Posts Plugin<\/strong><\/p>\n<ol>\n<li>wordpress_print_posts_html<\/li>\n<\/ol>\n<p>Then you need to return HTML code in your custom coded functions. An example:<\/p>\n<pre>add_filter('woocommerce_print_products_product_final_html', 'we_custom_pdf_template', 20, 3);\nfunction we_custom_pdf_template($html, $productId, $data) {\n\t$product = wc_get_product($productId);\n\tif(!$product) {\n\t\treturn;\n\t}\n\n\t$html = 'My Test';\n\n\treturn $html;\n}\n<\/pre>\n<h2>2nd option: <strong>contact our customization service<\/strong><\/h2>\n<p>Therefore please send us an email to <span \n                data-original-string='skStIGL0upFlAe\/Psar+Fg==e89B6EpuI1KPexZKhut6Gop9vJkN7hlwGpepr4JUhI7ZV8='\n                class='apbct-email-encoder'\n                title='This contact has been encoded by Anti-Spam by CleanTalk. Click to decode. To finish the decoding make sure that JavaScript is enabled in your browser.'>su<span class=\"apbct-blur\">*****<\/span>@<span class=\"apbct-blur\">******<\/span>ch.io<\/span> including the following information:<\/p>\n<ul>\n<li>desired template (PDF mockup)<\/li>\n<li>information where what data is coming from (best you comment that in the PDF template)<\/li>\n<li>make sure you mark custom data fields \/ ACF fields correctly<\/li>\n<\/ul>\n<p>Send your request to <a href=\"mailto:su*****@******ch.io\" data-original-string=\"tFIUdRmwMrhdCBk\/zQVetw==e89uJ0JSlCsvezMgVE78v0Xj8PZYz7inbom1fhx89PW57c=\" title=\"This contact has been encoded by Anti-Spam by CleanTalk. Click to decode. To finish the decoding make sure that JavaScript is enabled in your browser.\"><span \n                data-original-string='Mihsx8Yv49+4HO5YcajcAg==e899fF0eE5WhU0e7tm25Ir3ndLLSyAA4lalsG\/rcBqbK\/Q='\n                class='apbct-email-encoder'\n                title='This contact has been encoded by Anti-Spam by CleanTalk. Click to decode. To finish the decoding make sure that JavaScript is enabled in your browser.'>su<span class=\"apbct-blur\">*****<\/span>@<span class=\"apbct-blur\">******<\/span>ch.io<\/span><\/a>. Then we can give you a quote.<\/p>\n","protected":false},"author":1,"featured_media":0,"menu_order":0,"comment_status":"open","ping_status":"closed","template":"","product_cat":[],"class_list":["post-10339","faq","type-faq","status-publish","hentry","faq_topics-posts-to-pdf-faq","faq_topics-cart-pdf-faq","faq_topics-pdf-catalog-faq","faq_topics-print-products-faq","faq_topics-blog-to-pdf-faq"],"_links":{"self":[{"href":"https:\/\/www.welaunch.io\/en\/wp-json\/wp\/v2\/faq\/10339","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.welaunch.io\/en\/wp-json\/wp\/v2\/faq"}],"about":[{"href":"https:\/\/www.welaunch.io\/en\/wp-json\/wp\/v2\/types\/faq"}],"author":[{"embeddable":true,"href":"https:\/\/www.welaunch.io\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.welaunch.io\/en\/wp-json\/wp\/v2\/comments?post=10339"}],"version-history":[{"count":5,"href":"https:\/\/www.welaunch.io\/en\/wp-json\/wp\/v2\/faq\/10339\/revisions"}],"predecessor-version":[{"id":15404,"href":"https:\/\/www.welaunch.io\/en\/wp-json\/wp\/v2\/faq\/10339\/revisions\/15404"}],"wp:attachment":[{"href":"https:\/\/www.welaunch.io\/en\/wp-json\/wp\/v2\/media?parent=10339"}],"wp:term":[{"taxonomy":"product_cat","embeddable":true,"href":"https:\/\/www.welaunch.io\/en\/wp-json\/wp\/v2\/product_cat?post=10339"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}