Great plugin! I’m very much interested in sorting out a solution to this myself, or better yet seeing the coupon code printed automatically on the default templates.
I am so close!!! I think I just need a few small edits!! Can anyone point me in the right direction ?
Thanks! What a great plugin! 5 stars!
Still trying to get this to show up. I just updated to the latest release, but still no “coupon code” on PDF invoice, just the $dollar amount…
Has anyone managed to do this yet? Really need to show coupon code on the packing slip!
Ok, here is what I did to accomplish this.
** disclaimer ** There is much better ways to achieve this. This is very straight forward using the “template” method
Made a template in your theme folder ( copied the one in the plugin folder )
/woocommerce/print-order/print-content.php
All I added was a quick query to grab the “coupon code” if it exists:
At the end of the <table> I inserted this code:
<?php if( $order->get_used_coupons() ) {
$coupons_count = count( $order->get_used_coupons() );
echo '<div style="padding:5px; background-color: #eaeaea;"><h4 style="margin-top:10px;">' . __('Coupons used') . ' (' . $coupons_count . ')</h4>';
echo '<p><strong>' . __('Coupons used') . ':</strong> ';
$i = 1;
$coupons_list = '';
foreach( $order->get_used_coupons() as $coupon) {
$coupons_list .= $coupon;
if( $i < $coupons_count )
$coupons_list .= ', ';
$i++;
}
echo '<p style="padding:4px;"><strong>Coupons used (' . $coupons_count . ') :</strong> ' . $coupons_list . '</p></div>';
} // endif get_used_coupons ?>
Now it works perfect!! Just the way I want it to!
Hi Guys,
i am not quiet sure where to put which part of this plugin!
I want to show the discount codes on my woocommerce invoices.
Can anyone explain it to me? thx in advance