• Resolved anjanphukan

    (@anjanphukan)


    Hi,

    I want the invoice to send only for orders over $150. Will it be possible to set that way somehow?

    Thank you.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Contributor alexmigf

    (@alexmigf)

    Hi @anjanphukan

    Please try adding the code snippet below:

    add_filter( 'wpo_wcpdf_custom_attachment_condition', function( $condition, $order, $email_id, $document_type ) {
    	if ( ! empty( $order ) && $document_type == 'invoice' ) {
    		if( $order->get_total() < 150 ) {
    			$condition = false;
    		}
    	}
    	return $condition;
    }, 10, 4 );

    If you never worked with actions/filters please read this documentation page: How to use filters

    Thread Starter anjanphukan

    (@anjanphukan)

    Hi @alexmigf

    Thank you so much for your swift response.

    I have put the codes in the functions.php file of the child theme. Now I am waiting for the actual order. If it works then I will definitely update here.

    Regards.

    Thread Starter anjanphukan

    (@anjanphukan)

    Hi @alexmigf

    I am very sorry, my client’s actual requirement was different. But good to know that this plugin can achieve something like this and I’m pretty sure this code should work.

    Thank you so much once again.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Invoice above an amount’ is closed to new replies.