Php 如何将特定的装运区ID放入此代码中?
嗨,我有这个代码,我尝试了很多次把具体的航运区ID,但没有工作。有人能和我分享吗 url中的区域id示例 如何将区域_id=21放入此代码中Php 如何将特定的装运区ID放入此代码中?,php,wordpress,woocommerce,shipping,Php,Wordpress,Woocommerce,Shipping,嗨,我有这个代码,我尝试了很多次把具体的航运区ID,但没有工作。有人能和我分享吗 url中的区域id示例 如何将区域_id=21放入此代码中 // Put inside packages if ( $special_items ) { $packages[] = array( 'ship_via' => array( 'flat_rate' ), 'contents' => $s
// Put inside packages
if ( $special_items ) {
$packages[] = array(
'ship_via' => array( 'flat_rate' ),
'contents' => $special_items,
'contents_cost' => array_sum( wp_list_pluck( $special_items, 'line_total' ) ),
'applied_coupons' => WC()->cart->applied_coupons,
'destination' => array(
'country' => WC()->customer->get_shipping_country(),
'state' => WC()->customer->get_shipping_state(),
'postcode' => WC()->customer->get_shipping_postcode(),
'city' => WC()->customer->get_shipping_city(),
'address' => WC()->customer->get_shipping_address(),
'address_2' => WC()->customer->get_shipping_address_2(),
),
);
}
您可以使用
$\u GET['zone\u id']
通过将'zone\u id'=>21、
添加到包数组中来检索它?@kerbholz notwork@lessan如何输入此代码?我不是一个编码员,我试着去理解,只要做$zone\u id=$\u GET['zone\u id']
,然后在你的$zone\u id
变量中,你将在url中传递值,我不知道你想要的行为到底是什么