angelleye on "[Plugin: PayPal for WooCommerce] PayPal Plus: Order status set to "processing" and not "on-hold""

ساخت وبلاگ

The payment status is set to "completed", I see it in the backend "PayPal IPN".
I indeed use a prefix, but I adjusted that in the function.

In PayPal Plus, in Woocommerce, the prefix is set to "ODL-"

my function looks like this:

function update_wc_order_status($posted) {
$order_id = isset($posted['invoice']) ? str_replace('ODL-','',$posted['invoice']) : '';
if(!empty($order_id)) {
$order = new WC_Order($order_id);
$order->update_status('on-hold');
}
}
add_action('paypal_ipn_for_wordpress_payment_status_completed', 'update_wc_order_status', 10, 1);

I wrote this function in my functions.php of my child theme, that is also active on my site.

WordPress ...
ما را در سایت WordPress دنبال می کنید

برچسب : نویسنده : استخدام کار wpss بازدید : 215 تاريخ : پنجشنبه 13 خرداد 1395 ساعت: 13:08