Support » Plugin: WooCommerce Print Invoice & Delivery Note » Coupon Codes on Printout

Viewing 1 replies (of 1 total)
  • Hi @pegweb,

    Please try the code snippet I have mentioned in this message to add the applied coupon code in the Invoice.

    You will need to replace the below code on line number 196 to 208 in the print-content.php file of our WooCommerce Print Invoice & Delivery Note plugin.
    Path: woocommerce-delivery-notes/templates/print-order/print-content.php

    Code to replace:

    <?php if( $totals = $order->get_order_item_totals() ) :
                        $code = $order->get_used_coupons();
                        foreach( $totals as $total ) : ?>
                                 <?php if( $total['label'] == 'Discount' ) { ?>
                                    <td class="total-name"><span><?php echo $code[0] ?></span></td>
                                }else { ?>
                                    <td class="total-name"><span><?php echo $total['label']; ?></span></td>
                                <td class="total-item-price"></td>
                                <td class="total-quantity"></td>
                                <td class="total-price"><span><?php echo $total['value']; ?></span></td>
                        <?php endforeach; ?>
                    <?php endif; ?>

    Attaching a screenshot for your reference:

    Once you have replaced the above code at the mentioned place, please check and let us know whether the discount code is displaying in the invoice/delivery note/receipt or not.

    Let us know the result and if you have any questions.

    Kind Regards,

    • This reply was modified 2 months, 3 weeks ago by  Upendra Kapse.
Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.