Title: Show discount codes
Last modified: February 4, 2019

---

# Show discount codes

 *  Resolved [mollernina](https://wordpress.org/support/users/mollernina/)
 * (@mollernina)
 * [7 years, 6 months ago](https://wordpress.org/support/topic/show-discount-codes/)
 * 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](https://wordpress.org/support/users/priyankajagtap/)
 * (@priyankajagtap)
 * [7 years, 6 months ago](https://wordpress.org/support/topic/show-discount-codes/#post-11192241)
 * Hi [@mollernina](https://wordpress.org/support/users/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](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](https://wordpress.org/support/users/mollernina/)
 * (@mollernina)
 * [7 years, 6 months ago](https://wordpress.org/support/topic/show-discount-codes/#post-11208949)
 * 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](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](https://wordpress.org/support/users/priyankajagtap/)
 * (@priyankajagtap)
 * [7 years, 5 months ago](https://wordpress.org/support/topic/show-discount-codes/#post-11222820)
 * Hi [@mollernina](https://wordpress.org/support/users/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](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.

 * ![](https://ps.w.org/woocommerce-delivery-notes/assets/icon-256x256.jpg?rev=2829362)
 * [Print Invoice & Delivery Notes for WooCommerce](https://wordpress.org/plugins/woocommerce-delivery-notes/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/woocommerce-delivery-notes/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/woocommerce-delivery-notes/)
 * [Active Topics](https://wordpress.org/support/plugin/woocommerce-delivery-notes/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/woocommerce-delivery-notes/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/woocommerce-delivery-notes/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [priyankajagtap](https://wordpress.org/support/users/priyankajagtap/)
 * Last activity: [7 years, 5 months ago](https://wordpress.org/support/topic/show-discount-codes/#post-11222820)
 * Status: resolved