• Resolved sachinwebnexus

    (@sachinwebnexus)


    Hello,
    i have a wordpress site and woocommerce is enabled in it.Ihave different product on my site , when user purchase a product it send mail to user and the mail contains all the information about the order.
    I want when the product total cost is less than 100 ,it does not send email.

    $order = new WC_Order( $order_id );
    $total= $order->get_total();
    if($total<100)
    {
    does not send email
    }

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hi @sachinwebnexus,

    Here is the snippet to disable Completed Order email using your condition. Add this in your theme’s functions.php .

    add_filter( 'woocommerce_email_enabled_customer_completed_order', 'rt_enable_customer_completed_order_email', 10,2 );
    
    function rt_enable_customer_completed_order_email( $enabled, $order ){
        if ( $order->get_total() < 100 ) {
            return false;
        }
    }

    Try this out and let me know if it worked as you wanted.

    Thanks

    Thread Starter sachinwebnexus

    (@sachinwebnexus)

    Thanks for saving me ,code worked like charm.

    My pleasure. ??

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Woocommerce mail after order is completed’ is closed to new replies.