As a temporary solution, I did this:
class SequentialOrderNumbersMods {
/**
* Class constructor
*/
public function __construct()
{
add_action( 'woocommerce_process_shop_order_meta',
[ $this, 'processShopOrderMeta' ], 9, 2 );
}
// -----------------------------------------------------------------------
/**
* Apply the order number as soon as possible
*/
public function processShopOrderMeta( $postId, $post )
{
$order = wc_get_order( $postId );
try{
if( $postId == $order->get_order_number() )
{
$seqNum = \WC_Seq_Order_Number::instance();
$seqNum->set_sequential_order_number( $postId, $order );
}
}
catch( \Exception $e ){}
}
// -----------------------------------------------------------------------
}
It’s probably worth noting that you call this action, but only when HPOS is not enabled, currently on line 173. I don’t have HPOS enabled.
Regarding my last message, last paragraph. I meant to say that woocommerce_process_shop_order_meta is only hooked into when HPOS IS enabled, and I don’t have it enabled.
I’ve identified that same issue too.
Hey @skunkbad and @robinrsa,
Thank you both for getting in touch with us about Sequential Order Numbers. I’m happy to help and I apologize for the delay in reaching out to you. I appreciate the extra report that this happens when HPOS is enabled @skunkbad. I haven’t replicated this issue, but I have seen reports that our latest release resolved this problem.
Can you both tell me if you are on the most current version of Sequential Order Numbers, which is v1.10.1? The changelog shows the latest release addressed an issue with Order Numbers and HPOS. If you aren’t on this version could you please give an update a try?
Thank you,
Jessica | SkyVerge Plugins
Hey there,
It has been a long time since we heard from either of you, so I’m going to mark this topic as resolved.
If you’re still experiencing issues please take a look at our FAQs for more information and create a new thread if you have further questions.
Thanks,
Jessica 🙂