• Resolved mollernina

    (@mollernina)


    Hi, Is there a way to get the discount codes to show on the delivery note? The code the customer used to get a discount?

    Best regards
    Nina

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author priyankajagtap

    (@priyankajagtap)

    Hi @mollernina,

    Currently, it is not possible to show the discount code in the invoice but we have created some modification in our plugin code to achieve your requirement.

    For that, 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 the 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.

    Regards,
    Priyanka Jagtap

    Thread Starter mollernina

    (@mollernina)

    Hi Priyanka,

    Thanks for your help. But unfortunately it didnt work. The code is there now and here you can see a print-screen, https://www.dropbox.com/s/ukzueb84cspeyyi/2019-02-15%2009_47_52-Ordrar%20%E2%80%B9%20SMART%20planering%20%E2%80%94%20WordPress.png?dl=0

    I can see the discount price but not the name of the code. Is there something else I can do/change? I think it is a good feature.

    Kind regards
    Nina

    Plugin Author priyankajagtap

    (@priyankajagtap)

    Hi @mollernina,

    Thank you for sharing the screenshot.

    Can you please share the screenshot of the code you have replaced? Because the provided code is working fine at our end and displaying the coupon code in the invoice.
    See this screenshot: https://www.screencast.com/t/auKSMTFDJW

    Regards,
    Priyanka Jagtap

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Show discount codes’ is closed to new replies.