小编Ask*_*rci的帖子

如何获取 WooCommerce 运输方式成本和设置?

我正在尝试获取所有运输方式及其费率和名称。但是当我使用它时,WC()->shipping->get_shipping_methods()它只会返回空的费率数组和空的标题字符串。这是一个转储:

     array (size=3)
  'flat_rate' => 
    object(WC_Shipping_Flat_Rate)[1861]
      protected 'fee_cost' => string '' (length=0)
      public 'supports' => 
        array (size=3)
          0 => string 'shipping-zones' (length=14)
          1 => string 'instance-settings' (length=17)
          2 => string 'instance-settings-modal' (length=23)
      public 'id' => string 'flat_rate' (length=9)
      public 'method_title' => string 'Flat rate' (length=9)
      public 'method_description' => string 'Lets you charge a fixed rate for shipping.' (length=42)
      public 'enabled' => string 'yes' (length=3)
      public 'title' => string '' (length=0)
      public 'rates' => 
        array (size=0)
          empty
      public 'tax_status' …
Run Code Online (Sandbox Code Playgroud)

php wordpress location woocommerce shipping-method

2
推荐指数
1
解决办法
5706
查看次数

标签 统计

location ×1

php ×1

shipping-method ×1

woocommerce ×1

wordpress ×1