我正在构建一个自定义运输方式插件,我需要为其访问运输方式变量。
echo "<pre>";
print_r( $woocommerce->shipping->get_shipping_methods);
echo"</pre>";
在我的插件中这样做会返回一个空集或数组,而,
echo "<pre>";
print_r( $woocommerce->shipping->get_shipping_methods);
echo"</pre>";
返回预期值(可用的运输方式)任何想法是由于某种错误还是什么?
这是正在运输的物品 -->
WC_Shipping Object
(
[enabled] => 1
[shipping_methods] => Array
(
)
[shipping_total] => 0
[shipping_taxes] => Array
(
)
[shipping_label] =>
[shipping_classes] => Array
(
)
[packages] => Array
(
)
)