• Resolved fdelbene

    (@fdelbene)


    I’ve already customize some parts of the invoide in the custom theme but I cannot figure out how to add the Product short description to de list of items.

    Can you help me providing the snipet?

    Thanks!

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Contributor Yordan Soares

    (@yordansoares)

    Hello @fdelbene,

    Just to be sure, when you say custom theme, do you mean a custom template?

    If so, try adding this code snippet to your custom template:

    <?php
    if ( !empty($item['product']) ) {
        $_product = $item['product']->is_type( 'variation' ) ? wc_get_product( $item['product']->get_parent_id() ) : $item['product'];
        if ( method_exists( $_product, 'get_short_description' ) ) {
            echo $_product->get_short_description();
        }
    }
    ?>

    Let me know if it works!

    Thread Starter fdelbene

    (@fdelbene)

    It worked excelent!!!
    Thank you so much!!

    Plugin Contributor Yordan Soares

    (@yordansoares)

    Hello @fdelbene,

    Glad to know it works!

    By the way, this is also possible, without any code, using our Premium Templates. This extension includes a customizer that allows you to tailor your PDF documents, with product columns, totals rows, and custom blocks.

    The customizer includes Product description columns for both short and long product description:

    Screenshot of two product column blocks that allows to display the product short and long description

    You can also use the placeholders {{product_description_short}},{{product_description_long}} or {{product_description_variation}} within Product column:

    Screenshot of Product column that shows product short description placeholder

    Have a nice day!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Add Short description to Invoice’ is closed to new replies.