Skip to content

Instantly share code, notes, and snippets.

@iamsathyaseelan
Last active August 19, 2019 11:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save iamsathyaseelan/53cb05211cae50b2a67f3b23ff6cff0e to your computer and use it in GitHub Desktop.
Save iamsathyaseelan/53cb05211cae50b2a67f3b23ff6cff0e to your computer and use it in GitHub Desktop.
Code snippet to show next order coupon while printing invoice using "WooCommerce Print Invoice & Delivery Note"
/*
* 1. wcdn_after_branding => After the invoice logo
* 2. wcdn_after_addresses => After displaying the billing and shipping address
* 3. wcdn_after_info => After order details
* 4. wcdn_after_items => After the order items table
* 5. wcdn_after_notes => After the order notes
* 6. wcdn_after_thanks => After thanks
* 7. wcdn_after_colophon => After colophon
*
* Replace `wcdn_after_addresses` with any other mentioned hooks to change the display position
*/
add_action('wcdn_after_addresses',function($order){
do_action('rnoc_show_order_coupon',$order,true,'','');
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment