تابع ووکامرسی wc_paying_customer ذخیره اطلاعات محصول پرداخت شده به مشتری

تابع ووکامرسی wc_paying_customer – ذخیره اطلاعات محصول پرداخت شده به مشتری
Syntax – سینتکس
wc_paying_customer( (int) $order_id );
Parameters – پارامتر ها (1)
- 1- $order_id (int)
Usage – نحوه استفاده
if ( !function_exists( 'wc_paying_customer' ) ) {
require_once ABSPATH . PLUGINDIR . 'woocommerce/includes/wc-user-functions.php';
}
// The order id.
$order_id = -1;
// NOTICE! Understand what this does before running.
$result = wc_paying_customer($order_id);
Defined – محل تعریف
/includes/wc-user-functions.php
function wc_paying_customer( $order_id ) {
$order = wc_get_order( $order_id );
$customer_id = $order->get_customer_id();
if ( $customer_id > 0 && 'shop_order_refund' !== $order->get_type() ) {
$customer = new WC_Customer( $customer_id );
$customer->set_is_paying_customer( true );
$customer->save();
}
}
versions – نسخه ها
از نسخه : 3.0.2
نسخه فعلی : 3.0.6
دیگر نسخه ها : 3.0.6 , 3.0.5 , 3.0.4 , 3.0.3 , 3.0.2
ارسال نظر