I have a variable product with 5 variations (based on a single attribute - size).
So:
Product "Shirt" - product_id = 1234
- variation XS (extra small) - variation_id = 1235
- variation S (small) - variation_id = 1236
- variation M (medium) - variation_id = 1237
- variation L (large) - variation_id = 1238
- variation XL (extra large) - variation_id = 1239
I want to delete variation XL.
best I could find was (considering a variation is a post of 'product_variation' type):
<?php wc_delete_post(1239, true); ?>
This removes the variation and the associated metadata, however, I am still left with the size attribute in the list of possible attributes when editing product (in the attributes tab) see the attached pic.
Does anybody have a php code snipped that would fully remove a product variation including this attribute entry.
