Use Woo functions to determine “unpaid” status
-
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)
Viewing 3 replies - 1 through 3 (of 3 total)
- You must be logged in to reply to this topic.