Deleting variations in bulk
-
I have a product in WooCommerce that has three attributes (gender, top size, pants size).
There are 3 types of gender then 17 possible sizes for the tops and the same set of 17 possible sizes for the pants.
When I create the product and let WooCommerce create all of the variations, it creates 3*17*17=867 product variations due to creating all possible combinations.
The actual variations I need are only about 170, as each gender only uses a subset of the 17 sizes. As I deleted about 30 variations via the admin interface I realised I wasn’t going to do this nearly 700 times and started looking for a better way.
I ran an SQL query to find all of the combinations I didn’t need then set the variations I didn’t need to ‘trash’ status.
I figured this worked because when I went into the product again, the number of variations had reduced to 170. But when I go to the front end, it behaves as if all the variations still exist. (i.e. when I filter by Gender, the other attribute fields don’t limit themselves to the sizes that exist for the variations of that gender).
I’ve progressively done all of the following to try to fix the issue with no luck: 1. deleted the post_meta associated with each of the variations 2. deleted the variation itself (i.e. delete from the database rather than just set it to ‘trash’ status) 3. cleared WooCommerce transients 4. copied the product to a new duplicate of itself and saved it as a new product.
The behaviour is still the same…what am I missing?
thanks Aaron
The topic ‘Deleting variations in bulk’ is closed to new replies.