Support » Plugin: WooCommerce PDF Invoices & Packing Slips » Coupons used in invoice?

  • Resolved clk87

    (@clk87)


    Hi there,

    Thank you for a great free edition of the plugin. A client I’m working with is wondering if we can display the coupons redeemed during the checkout process on the invoice, is this possible?

    Thank you

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Ewout

    (@pomegranate)

    In the free version you can add the used coupons with a small code snippet:

    
    //Add used coupons to PDFs
    add_action( 'wpo_wcpdf_after_order_details', 'wpo_wcpdf_coupons_used', 10, 2 );
    function wpo_wcpdf_coupons_used ($template_type, $order) {
    	if( $used_coupons = $order->get_used_coupons() ) {
    		$coupons_list = implode(', ', $used_coupons);
    		echo '<h4>' . __('Coupons used') . '</h4>';
    		echo '<p>' . $coupons_list . '</p>';
    	}
    }
    

    If you haven’t worked with code snippets or functions.php please read this: How to use filters

    With our Premium Templates you can do this without any coding, either by placing the {{used_coupons}}:

    or by enabling it for the discount row in the totals:

    clk87

    (@clk87)

    Thank you very much for your help! I’ll try out the function you’ve provided, many thanks.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Coupons used in invoice?’ is closed to new replies.