Can’t display product description
-
I love your plug-in but I am really struggling to get the invoice to show the product description. I have read over and over your tutorial on how to add either a theme hook or create a custom template. But neither way works for me.
I woud prefer to add the code in your documentation to the theme functions file:
add_action( 'wpo_wcpdf_after_item_meta', 'wpo_wcpdf_show_product_full_description', 10, 3 ); function wpo_wcpdf_show_product_full_description ( $template_type, $item, $order ) { if (empty($item['product'])) return; $_product = wc_get_product( $item['product']->get_parent_id() ); $description = $_product->get_description(); printf('<div class="product-description">%s</div>', $description ); }
But, when I do this, I get a fatal error:
Fatal error: Call to a member function get_short_description() on boolean
Please can you help!
If you can supply a template as your ‘Simple’ basic template, but with the description already added, that would be helpful as well.
Many thanks.
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Can’t display product description’ is closed to new replies.