Quantcast
Channel: WordPress.org Forums » All Topics
Viewing all articles
Browse latest Browse all 512573

Bestellstatus Nachnahme

$
0
0

Replies: 0

Hallo,
ich möchte gernde den Default-Bestellstatus bei Nachnahme von “processing” auf “pending” setzen. Dazu habe ich

add_action( 'woocommerce_thankyou', 'my_order_status', 10, 1 );
function my_order_status( $order_id ) {
	if ( ! $order_id ) {
		return;
	}
	$order = wc_get_order( $order_id );
	if ( ( get_post_meta( $order->id, '_payment_method', true ) === "cod"  ) && ( $order->post_status === 'wc-processing' ) ) {
		$order->update_status('pending');
	}
}

eingesetzt, aber es funktioniert nicht,was an germanized liegen muss, da es ohne Germanized funktioniert. Könnt Ihr mir sagen, was ich ändern muss?

Vielen Dank.


Viewing all articles
Browse latest Browse all 512573

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>