• Your plugin is hard coding a check for “pending” status which means that custom order statuses are not working as intended. For “customer invoice” email, the following code is used:

    	if ( $order->has_status( 'pending' ) ) {

    This means I cannot add my own order status. If this was changed to follow the Woo approach, then custom order statuses could be used:

    <?php if ( $order->needs_payment() ) { ?>

    The “needs_payment” function uses

    $valid_order_statuses = apply_filters( 'woocommerce_valid_order_statuses_for_payment', array( 'pending', 'failed' ), $this );

    which gives other plugins the option to add an upaid status with the filter.

    Or you could add your own filter to allow 3rd party plugin providers to add their own status.

    Thank you for considering my suggestion!

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support karlalevelup

    (@karlalevelup)

    Hi, Edith!

    I’m happy to assist you with this.

    Custom order statuses are added to WooCommerce and our Email Designer handles customization for the core WooCommerce email templates.

    The if ( $order->has_status( ‘pending’ ) ) condition is checked for the “Customer Invoice” and Customer Renewal Invoice email types. Did you also add a new email type for the order status that you added? Am I correct in understanding that the issue is that your email template is not shown in our Email Customizer preview?

    If I misunderstood, could you expound your use case/customization so I can better assess what needs to be done? For example, do you want to use a different body text for your custom status?

    Regards,
    Karla

    Thread Starter Edith Allison

    (@terragirl)

    Hi Karla,

    Thank you for getting back to me!

    To recap, the order invoice has two possible content pieces: If the order is unpaid (pending), it sends a “please pay” button. Otherwise it sends a “your order is paid” confirmation.

    I added a custom order status “checking” which is an unpaid order status, equivalent to “pending”. But due to the hard-coding of the status in your plugin, when a customer got the invoice with an order with status “checking”, the content of the order invoice said “your order is paid” which was wrong.

    What would be great is if instead of using if ( $order->has_status( ‘pending’ ) ) you either use the Woo if ( $order->needs_payment() ) which already has a filter to add custom statuses or add your own filter so that other plugin developers can add statuses which are equivalent to “pending”.

    As it currently stands, any status which is not “pending” results in the order invoice saying “your order is paid”.

    Plugin Support karlalevelup

    (@karlalevelup)

    Hi, Edith!

    Thanks for the additional info.

    I’ve escalated this concern so it can be checked.

    I’ll keep you posted for any update I may have.

Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.