Skip to content
Advertisement

How to get Woocommerce Variation ID?

I’ve already had this code on functions.php

This code is to add a new field on each product variation to have datetime input field, so variations would automatically expired when the current date is past the input date.

JavaScript

This is to add a new field on each variation of Wocommerce.

What I am trying to do is to get each “_text_field_date_expire” meta so I could delete expired variation for each of the products..

How do I get each woocommerce variation ID on functions.php so I could add a rule that it will expire when it is already past the current date right now?

JavaScript

This code is the one that I will use to get the datetime field, but not sure how I could get each $variation_id field?

Thanks!

Advertisement

Answer

Try this one:

JavaScript

Hope this will helps you. For more information:

User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement