2 回答

TA貢獻(xiàn)1810條經(jīng)驗(yàn) 獲得超5個(gè)贊
要從對(duì)象獲取訂單詳細(xì)信息WC_Subscription
,您首先需要使用以下方法獲取父 ID(即訂單 ID)get_parent_id()
:
$order_id?=?$subscription->get_parent_id();
然后,您將使用以下命令從訂單 ID 獲取 WC_Order 對(duì)象:
$order?=?wc_get_order(?$order_id?);

TA貢獻(xiàn)1936條經(jīng)驗(yàn) 獲得超7個(gè)贊
可以使用以下方法直接從 WC_ 訂閱對(duì)象獲取一些詳細(xì)信息
$subscription->get_id() //subscription id
$subscription->get_parent_id() //order id
$subscription->get_currency()
$subscription->get_customer_note()
$subscription->get_prices_include_tax()
$subscription->get_payment_method()
$subscription->get_payment_method_title()
$subscription->get_billing_first_name()
$subscription->get_billing_last_name()
$subscription->get_billing_company()
$subscription->get_billing_address_1()
$subscription->get_billing_address_2()
$subscription->get_billing_city()
$subscription->get_billing_state()
$subscription->get_billing_postcode()
$subscription->get_billing_country()
$subscription->get_billing_email()
$subscription->get_billing_phone()
$subscription->get_shipping_first_name()
$subscription->get_shipping_last_name()
$subscription->get_shipping_company()
$subscription->get_shipping_address_1()
$subscription->get_shipping_address_2()
$subscription->get_shipping_city()
$subscription->get_shipping_state()
$subscription->get_shipping_postcode()
$subscription->get_shipping_country()
$subscription->get_order_key()
$subscription->get_date_created()
$subscription->get_date_modified()
- 2 回答
- 0 關(guān)注
- 187 瀏覽
添加回答
舉報(bào)