تابع ووکامرسی wc_get_order دریافت سفارش بر اساس آیدی

تابع ووکامرسی wc_get_order دریافت سفارش بر اساس آیدی

تابع ووکامرسی wc_get_order – دریافت سفارش بر اساس آیدی

Syntax – سینتکس

(WC_Order|WC_Refund) wc_get_order( (bool) $the_order = false ); 

Parameters – پارامتر ها (1)

  • 1- $the_order (bool)

Usage – نحوه استفاده

if ( !function_exists( 'wc_get_order' ) ) { 
    require_once ABSPATH . PLUGINDIR . 'woocommerce/includes/wc-order-functions.php'; 
} 
  
// Post object or post ID of the order. 
$the_order = false; 
  
// NOTICE! Understand what this does before running. 
$result = wc_get_order($the_order); 
    

Defined – محل تعریف

/includes/wc-order-functions.php

function wc_get_order( $the_order = false ) { 
    if ( ! did_action( 'woocommerce_after_register_post_type' ) ) { 
        wc_doing_it_wrong( __FUNCTION__, __( 'wc_get_order should not be called before post types are registered (woocommerce_after_register_post_type action).', woocommerce ), '2.5' ); 
        return false; 
    } 
    return WC()->order_factory->get_order( $the_order ); 
} 

versions – نسخه ها

از نسخه : 2.2

نسخه فعلی : 3.0.6

دیگر نسخه ها : 3.0.6 , 3.0.5 , 3.0.4 , 3.0.3 , 3.0.2

ارسال نظر

جهت استفاده از کد حتما از تگ pre استفاده نمایید .

contact us