Woocommerce API使发货类null无效?

时间:2018-04-21 06:51:25

标签: wordpress api woocommerce woocommerce-rest-api

我已经为某些产品添加了运输类,但我不是故意的。

我希望他们回到没有运输类或null。

目前是节目:

[ “shipping_class”] =>           string(3)“myw”

如果没有货运类,则显示为:

[shipping_class] =>

我正在上传['shipping_class'] => null但它不会改变......任何想法?

array(1) {
  ["update"]=>
  array(1) {
    [0]=>
    array(66) {
      ["id"]=>
      int(6270)
      ["name"]=>
      string(25) "Washdown Pump Kit - 20LPM"
      ["slug"]=>
      string(23) "washdown-pump-kit-20lpm"
      ["permalink"]=>
      string(66) "https://site/store/product/washdown-pump-kit-20lpm/"
      ["date_created"]=>
      string(19) "2018-01-17T20:59:40"
      ["date_created_gmt"]=>
      string(19) "2018-01-17T20:59:40"
      ["date_modified"]=>
      string(19) "2018-01-17T20:59:40"
      ["date_modified_gmt"]=>
      string(19) "2018-01-17T20:59:40"
      ["type"]=>
      string(6) "simple"
      ["status"]=>
      string(7) "publish"
      ["featured"]=>
      bool(false)
      ["catalog_visibility"]=>
      string(7) "visible"
      ["description"]=>
      string(40) "Washdown Pump Kit - 20LPM 70PSI"
      ["short_description"]=>
      string(0) ""
      ["sku"]=>
      string(16) "SFDW1-055-070-51"
      ["price"]=>
      string(6) "159.00"
      ["regular_price"]=>
      string(6) "159.00"
      ["sale_price"]=>
      string(0) ""
      ["date_on_sale_from"]=>
      NULL
      ["date_on_sale_from_gmt"]=>
      NULL
      ["date_on_sale_to"]=>
      NULL
      ["date_on_sale_to_gmt"]=>
      NULL
      ["price_html"]=>
      string(175) "$159.00 Inc. GST"
      ["on_sale"]=>
      bool(false)
      ["purchasable"]=>
      bool(true)
      ["total_sales"]=>
      int(0)
      ["virtual"]=>
      bool(false)
      ["downloadable"]=>
      bool(false)
      ["downloads"]=>
      array(0) {
      }
      ["download_limit"]=>
      int(-1)
      ["download_expiry"]=>
      int(-1)
      ["external_url"]=>
      string(0) ""
      ["button_text"]=>
      string(0) ""
      ["tax_status"]=>
      string(7) "taxable"
      ["tax_class"]=>
      string(0) ""
      ["manage_stock"]=>
      bool(true)
      ["stock_quantity"]=>
      int(4)
      ["in_stock"]=>
      bool(true)
      ["backorders"]=>
      string(2) "no"
      ["backorders_allowed"]=>
      bool(false)
      ["backordered"]=>
      bool(false)
      ["sold_individually"]=>
      bool(false)
      ["weight"]=>
      string(4) "3720"
      ["dimensions"]=>
      array(3) {
        ["length"]=>
        string(3) "400"
        ["width"]=>
        string(3) "142"
        ["height"]=>
        string(3) "450"
      }
      ["shipping_required"]=>
      bool(true)
      ["shipping_taxable"]=>
      bool(true)
      ["shipping_class"]=>
      string(3) "myw"
      ["shipping_class_id"]=>
      int(499)
      ["reviews_allowed"]=>
      bool(true)
      ["average_rating"]=>
      string(1) "0"
      ["rating_count"]=>
      int(0)
      ["related_ids"]=>
      array(2) {
        [0]=>
        int(5857)
        [1]=>
        int(5629)
      }
      ["upsell_ids"]=>
      array(0) {
      }
      ["cross_sell_ids"]=>
      array(0) {
      }
      ["parent_id"]=>
      int(0)
      ["purchase_note"]=>
      string(0) ""
      ["categories"]=>
      array(2) {
        [0]=>
        array(3) {
          ["id"]=>
          int(405)
          ["name"]=>
          string(9) "12V Pumps"
          ["slug"]=>
          string(9) "12v-pumps"
        }
        [1]=>
        array(3) {
          ["id"]=>
          int(243)
          ["name"]=>
          string(5) "Pumps"
          ["slug"]=>
          string(5) "pumps"
        }
      }
      ["tags"]=>
      array(0) {
      }
      ["images"]=>
      array(1) {
        [0]=>
        array(9) {
          ["id"]=>
          int(6276)
          ["date_created"]=>
          string(19) "2018-01-17T20:59:53"
          ["date_created_gmt"]=>
          string(19) "2018-01-17T20:59:53"
          ["date_modified"]=>
          string(19) "2018-01-17T20:59:53"
          ["date_modified_gmt"]=>
          string(19) "2018-01-17T20:59:53"
          ["src"]=>
          string(75) "https://site/store/wp-content/uploads/2018/01/image-662.jpeg"
          ["name"]=>
          string(0) ""
          ["alt"]=>
          string(0) ""
          ["position"]=>
          int(0)
        }
      }
      ["attributes"]=>
      array(0) {
      }
      ["default_attributes"]=>
      array(0) {
      }
      ["variations"]=>
      array(0) {
      }
      ["grouped_products"]=>
      array(0) {
      }
      ["menu_order"]=>
      int(0)
      ["meta_data"]=>
      array(0) {
      }
      ["_links"]=>
      array(2) {
        ["self"]=>
        array(1) {
          [0]=>
          array(1) {
            ["href"]=>
            string(61) "https://site/store/wp-json/wc/v2/products/6270"
          }
        }
        ["collection"]=>
        array(1) {
          [0]=>
          array(1) {
            ["href"]=>
            string(56) "https://site/store/wp-json/wc/v2/products"
          }
        }
      }
    }
  }
}

0 个答案:

没有答案