According to my tests, the WooCommerce node is not ready to update variable products, as it does not perform the variation update when you tell it its ID.
As I see in the code of the WooCommerce node, it only updates simple products since only the /products/${productId} instruction appears and the /products/<product_id>/variations/<id> instruction that updates variable products through the WooCommerce API does not appear.
if (operation === 'update') {
const productId = this.getNodeParameter('productId', i) as string;
const updateFields = this.getNodeParameter('updateFields', i);
const body: IProduct = {};
setFields(updateFields, body);
const images = (this.getNodeParameter('imagesUi', i) as IDataObject)
.imagesValues as IImage[];
if (images) {
body.images = images;
}
const dimension = (this.getNodeParameter('dimensionsUi', i) as IDataObject)
.dimensionsValues as IDimension;
if (dimension) {
body.dimensions = dimension;
}
const metadata = (this.getNodeParameter('metadataUi', i) as IDataObject)
.metadataValues as IDataObject[];
if (metadata) {
body.meta_data = metadata;
}
responseData = await woocommerceApiRequest.call(
this,
'PUT',
`/products/${productId}`,
body,
);
}
As you know, variable products in WooCommerce create a product ID for each variation, so to update a variation you must always tell it the variation ID.
In the example that you will find in Producto variable – Rainy Daughter the variable product (ID 11) has three variations (S|M|L) with respective IDs (12|13|14). To update the sale_price and date_on_sale_to fields of the variation S (ID 12) you must create a workflow like the following that updates directly through the WooCommerce API.