{"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":"

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

First option: code your own template in PHP<\/strong>.<\/h2>\n

Print products PDF<\/strong><\/p>\n

Therefore you can use one of the two filters:<\/p>\n

    \n
  1. woocommerce_print_products_product_html<\/li>\n
  2. woocommerce_print_products_product_final_html<\/li>\n<\/ol>\n

    Print Posts Plugin<\/strong><\/p>\n

      \n
    1. wordpress_print_posts_html<\/li>\n<\/ol>\n

      Then you need to return HTML code in your custom coded functions. An example:<\/p>\n

      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

      2nd option: contact our customization service<\/strong><\/h2>\n

      Therefore please send us an email to su*****<\/span>@******<\/span>ch.io<\/span> including the following information:<\/p>\n