• Hi There awesome plugin,

    I am running into some difficulties. I am using this function `add_action( ‘wpo_wcpdf_after_item_meta’, ‘wpo_wcpdf_show_product_description’, 10, 3 );
    function wpo_wcpdf_show_product_description ( $template_type, $item, $order ) {
    global $wpo_wcpdf;
    printf(‘<div class=”product-description”>%s</div>’, $item[‘product’]->post->post_content );
    }`
    to display the post content . How ever is there a way that i could design the layout of %s because everything is on one line. here is an example of my post_content.
    'post_content' => " Range: $range</br>&nbsp;Width: $width&nbsp;</br>Length: $length&nbsp;</br>Fabric: $fabric&nbsp;</br>Style: $style&nbsp;</br>Lining: $lining&nbsp;</br>Opening: $opening&nbsp;</br>Voile: $voile&nbsp;</br>Track: $track&nbsp;</br>Rod: $rod&nbsp;</br>Pulley: $pulley",
    Thanking you in advance

    https://wordpress.org/plugins/woocommerce-pdf-invoices-packing-slips/

Viewing 1 replies (of 1 total)
  • Plugin Contributor Ewout

    (@pomegranate)

    How come the post content is with </br> and not <br> or <br/>? I’m guessing the </br> is not recognized by the PDF engine because the tag doesn’t exist officially (<br> is self-closing).

    I recommend looking into why this faulty HTML got there in the first place – if you can fix that it will also be formatted with actual line breaks.

    Hope that helps!
    Ewout

Viewing 1 replies (of 1 total)

The topic ‘Layout The Post Content via function’ is closed to new replies.