Viewing 1 replies (of 1 total)
  • Plugin Support Upendra Kapse

    (@wpupen)

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

    Attaching a screenshot for your reference: https://www.screencast.com/t/AtlSoMyQSH

    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,
    Upendra

    • This reply was modified 5 years, 7 months ago by Upendra Kapse.
Viewing 1 replies (of 1 total)
  • The topic ‘Coupon Codes on Printout’ is closed to new replies.