dqcz57269 2016-06-28 08:18
浏览 320

使用WooCommerce Rest Api添加产品 - 股票问题

I am trying to add a WooCommerce product from one Wordpress site to another using WooCommerce Rest Api. It's working in some case, but stock management and stock quantity are not working. here is code…

Client library:
https://packagist.org/packages/woothemes/woocommerce-api

Data:

    $data = [
       'name' => 'Premium Quality',
       'title' => 'test',
       'type' => 'simple',
       'manage_stock' => true,
       'stock_quantity' => 40,
       'regular_price' => '21.99',
       'description' => 'Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.',
       'short_description' => 'Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.',
];

Response:
I am getting empty response in manage_stock and stock_quantity.

Same thing happen when I change the product type to variation, it isn't working either if I update the data sent, according to WooCommerce Rest Api.

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 有偿求跨组件数据流路径图
    • ¥15 写一个方法checkPerson,入参实体类Person,出参布尔值
    • ¥15 我想咨询一下路面纹理三维点云数据处理的一些问题,上传的坐标文件里是怎么对无序点进行编号的,以及xy坐标在处理的时候是进行整体模型分片处理的吗
    • ¥15 CSAPPattacklab
    • ¥15 一直显示正在等待HID—ISP
    • ¥15 Python turtle 画图
    • ¥15 关于大棚监测的pcb板设计
    • ¥15 stm32开发clion时遇到的编译问题
    • ¥15 lna设计 源简并电感型共源放大器
    • ¥15 如何用Labview在myRIO上做LCD显示?(语言-开发语言)