How to add attributes to WooCommerce Product?
I need to add several attributes when creating the product using Make module
For now, I’m trying to add attributes with array [{“id”: 1, “position”: 0}] but as a result, the attributes are not added, the output is an empty array.
blueprint.json (1.0 MB)
INPUT:
[
{
“name”: “test attributes numeric position”,
“tags”: ,
“images”: ,
“metaData”: [
{
“key”: “shipping_time”,
“value”: “shipping_time”
},
{
“key”: “delivery_options”,
“value”: “delivery_options”
},
{
“key”: “features”,
“value”: “features”
},
{
“key”: “what_is_in_the_box”,
“value”: “what_is_in_the_box”
},
{
“key”: “size”,
“value”: “size”
},
{
“key”: “_iconic_wsb_product_page_order_bump_ids”,
“value”: “”
},
{
“key”: “_iconic_wsb_product_page_bump_modal_ids”,
“value”: “”
}
],
“taxStatus”: “shipping”,
“attributes”: [
{
“id”: 2,
“position”: 0
},
{
“id”: 4,
“position”: 1
}
],
“categories”: ,
“dimensions”: {},
“stock_status”: “instock”,
“catalogVisibility”: “visible”
}
]
OUTPUT:
[
{
“id”: 485,
“name”: “test attributes numeric position”,
“slug”: “test-attributes-numeric-position”,
“permalink”: “https://”,
“type”: “simple”,
“status”: “publish”,
“featured”: false,
“description”: null,
“sku”: null,
“price”: null,
“purchasable”: false,
“virtual”: false,
“downloadable”: false,
“downloads”: ,
“backorders”: “no”,
“backordered”: false,
“weight”: null,
“dimensions”: {
“length”: null,
“width”: null,
“height”: null
},
“categories”: [
{
“id”: 15,
“name”: “Uncategorized”,
“slug”: “uncategorized”
}
],
“tags”: ,
“images”: ,
“attributes”: ,
“variations”: ,
“dateCreated”: “2023-09-29T05:02:39.000Z”,
“dateModified”: “2023-09-29T05:02:39.000Z”,
“catalogVisibility”: “visible”,
“shortDescription”: null,
“regularPrice”: null,
“salePrice”: null,
“dateOnSaleFrom”: null,
“dateOnSaleTo”: null,
“onSale”: false,
“totalSales”: 0,
“downloadLimit”: -1,
“downloadExpiry”: -1,
“externalUrl”: null,
“buttonText”: null,
“taxStatus”: “shipping”,
“taxClass”: null,
“manageStock”: false,
“stockQuantity”: null,
“backordersAllowed”: false,
“lowStockAmount”: null,
“soldIndividually”: false,
“shippingRequired”: true,
“shippingTaxable”: true,
“shippingClass”: null,
“shippingClassId”: 0,
“reviewsAllowed”: true,
“averageRating”: “0”,
“ratingCount”: 0,
“upsellIds”: ,
“crossSellIds”: ,
“parentId”: 0,
“purchaseNote”: null,
“defaultAttributes”: ,
“groupedProducts”: ,
“menuOrder”: 0,
“priceHtml”: null,
“relatedIds”: [
305,
363,
284,
357,
352
],
“metaData”: [
{
“id”: 8654,
“key”: “shipping_time”,
“value”: “shipping_time”
},
{
“id”: 8655,
“key”: “delivery_options”,
“value”: “delivery_options”
},
{
“id”: 8656,
“key”: “features”,
“value”: “features”
},
{
“id”: 8657,
“key”: “what_is_in_the_box”,
“value”: “what_is_in_the_box”
},
{
“id”: 8658,
“key”: “size”,
“value”: “size”
},
{
“id”: 8659,
“key”: “_iconic_wsb_product_page_order_bump_ids”,
“value”: null
},
{
“id”: 8660,
“key”: “_iconic_wsb_product_page_bump_modal_ids”,
“value”: null
}
],
“stockStatus”: “instock”,
“hasOptions”: false,
“permalinkTemplate”: “https://”,
“generatedSlug”: “test-attributes-numeric-position”,
“galleryImages”:
}
]