Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/wordpress/13.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Node.js 使用NodeJS的woocommerceapi添加了不完整的产品变体_Node.js_Wordpress_Api_Woocommerce - Fatal编程技术网

Node.js 使用NodeJS的woocommerceapi添加了不完整的产品变体

Node.js 使用NodeJS的woocommerceapi添加了不完整的产品变体,node.js,wordpress,api,woocommerce,Node.js,Wordpress,Api,Woocommerce,使用API向现有产品添加变体时,装运类别和所选变体将被忽略。我正在使用NodeJS和woocommerceapi v1.4.2 使用NodeJS和上述包尝试使用以下有效负载向现有产品添加变体: { sku: '12751_1551793442001', regular_price: '198', attributes: [ { id: 1551793442001, name: 'mount', shipping_class: 'band-l',

使用API向现有产品添加变体时,装运类别和所选变体将被忽略。我正在使用NodeJS和woocommerceapi v1.4.2

使用NodeJS和上述包尝试使用以下有效负载向现有产品添加变体:

{ sku: '12751_1551793442001',
  regular_price: '198',
  attributes:
   [ { id: 1551793442001,
       name: 'mount',
       shipping_class: 'band-l',
       option: 'Framed' } ] }
{ sku: '12751_1551793442002',
  regular_price: '119',
  attributes:
   [ { id: 1551793442002,
       name: 'mount',
       shipping_class: 'band-i',
       option: 'mounted' } ] }
{ sku: '12751_1551793442003',
  regular_price: '109',
  attributes:
   [ { id: 1551793442003,
       name: 'mount',
       shipping_class: 'band-d',
       option: 'Print only' } ] }
添加了变体,每个变体都有正确的价格,但没有关联的“名称”。

装运带未设置,即使已在API请求中设置,但价格已设置。

邮资带在商业中已经存在


我有点不知所措,无法解释这一点,有人有什么见解吗?

在与WooCommerce开发人员沟通后,似乎有两种不同类型的属性,本地和全局。全局属性有一个ID,而本地属性没有。为了解决我的问题,我省略了ID并包含了名称:

另外,shipping_课程的位置也不正确

{ 
  sku: '12751_1551793442001',
  regular_price: '198',
  shipping_class: 'band-l',
  attributes: [
    {
      name: 'mount',
      option: 'Framed' 
    } 
  ]
}

在与WooCommerce开发人员沟通之后,似乎有两种不同类型的属性,本地和全局。全局属性有一个ID,而本地属性没有。为了解决我的问题,我省略了ID并包含了名称:

另外,shipping_课程的位置也不正确

{ 
  sku: '12751_1551793442001',
  regular_price: '198',
  shipping_class: 'band-l',
  attributes: [
    {
      name: 'mount',
      option: 'Framed' 
    } 
  ]
}