• Resolved prepu

    (@prepu)


    Hi Ewout, I am very happy with your plugin. It is simply great.

    I would like to make a request: I have noticed that everytime that is an order it makes an invoice. But, I have a lot of users that I make their orders with 100% of discount. I mean, I am selling subscriptions and for premium users I give them for free.

    Can you add a checkbox that disable the making invoices if the amount is 0 euros? There is no sense of keep making invoices.

    Thanks.

    https://www.ads-software.com/plugins/woocommerce-pdf-invoices-packing-slips/

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Contributor Ewout

    (@pomegranate)

    Hi Prepu,
    The last update included just what you need, a filter that determines whether an invoice is created/emailed or not.

    add_filter( 'wpo_wcpdf_custom_email_condition', 'wpo_wcpdf_no_zero' , 10, 3 );
    
    function wpo_wcpdf_no_zero( $condition, $order, $status ) {
    	$order_total = get_post_meta($order->id,'_order_total',true);
    	if ( $order_total > 0 ) {
    		return true; // pdf is attached
    	} else {
    		return false; // no pdf
    	}
    }
    Thread Starter prepu

    (@prepu)

    Hi again Ewout,

    I have added the code to my funtions.php and it works unless you press the “invoice” button in Woocommerce / Orders.

    I have noticed that if I would like to have a look to the “invoice” it creates the invoice number. Perhaps it would be a good idea to disable the invoice button…

    It is not an important issue.

    Sorry for my bad english… ??

    Plugin Contributor Ewout

    (@pomegranate)

    Yes, I’m assuming some intelligence from the shop manager. If the shop manager decides to create an invoice, then I’m not going to tell them they shouldn’t :o)

    Everybody has very specific options, and this plugin would become a monster if I would integrate every single one of them in the core plugin. With filters like the one above and many others I already provide a lot of options for advanced customisation, but even that has a limit. I hope you understand!

    That said, there are also options that are used a lot – like the invoice number formatting. I will probably make that a setting in the next release or the one after that.

    Thread Starter prepu

    (@prepu)

    Yes of course!

    I know it is a silly (small) detail.

    Your plugin is great!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘If amount of the order is 0, don't make invoice’ is closed to new replies.