Disable receipt emails with 0 total for Vantage and Clipper themes

Receipt emails always send if option "Charge for Items" enabled in Vantage or Clipper themes. Even in cases when order total amount is 0.

There is no setting to disable such empty receipt emails, but it can be done using a small mod.

You can add it in a custom plugin or child theme functions.php file or use Code Snippets plugin (more details in the instruction).

function arthemes_org_send_user_receipt( $args ) { if ( ! empty( $args['order'] ) ) { $order = $args['order']; if ( ! (float) $order->get_total() ) { $args['to'] = null; } } return $args; } add_filter( 'appthemes_send_user_receipt', 'arthemes_org_send_user_receipt' );

This code filters parameters of the receipt email and removes the receiver if order total is 0. This will work fine in most cases. But be careful using AppThemes Coupons plugin and 100% discounts as it may also generate orders with zero total.

Read more about Disable receipt emails with 0 total for Vantage and Clipper themes
  • 0