Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Contributor kluver

    (@kluver)

    Hi @mariuszo,

    That is certainly possible. ??

    You can add the following code snippet to your functions.php:

    
    add_action( 'wpo_wcpdf_after_order_data', 'wpo_wcpdf_shipping_option', 10, 2 );
    function wpo_wcpdf_shipping_option ($template_type, $order) {
        if ($template_type == 'invoice') {
            $document = wcpdf_get_document( $template_type, $order );
            ?>
            <tr class="shipping-option">
                <th>Shipping option:</th>
                <td><?php echo $order->get_shipping_method(); ?></td>
            </tr>
            <?php
        }
    }

    If you never worked with code snippets or functions.php before please read this guide: How to use filters

    With kind regards,

    Michael

    • This reply was modified 7 years, 2 months ago by kluver.
    Thread Starter mariuszo

    (@mariuszo)

    Quick, simple and perfect as usual ??
    Can I recommend and rate you somewhere?
    A lot of other authors should learn from you how support shoul work.

    Plugin Contributor Ewout

    (@pomegranate)

    Hello Mario,
    Very glad to hear that does the trick for you! By the way, it looks look you are using the Premium Templates, in this case you can even do this without a code snippet, simply by adding a custom block (set to type: Text) with the placeholder {{shipping_method}}. More information in the documentation: Using custom blocks.

    You can rate us here on www.ads-software.com: Reviews

    Thanks in advance and have a fantastic day!
    Ewout

    • This reply was modified 7 years, 2 months ago by Ewout.
    Thread Starter mariuszo

    (@mariuszo)

    Hi Ewout!
    Indded i was looking for that option within custom blocks but apparently not good enough ??

    Thx again!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Add name of shipping option to invoice’ is closed to new replies.