Hi, I am trying to populate a SELECT field on a WooCommerce Product page with the list of its variations.
This seems frustratingly tough to achieve. Has anyone done similar and could help me out?
It was easy to write a custom WP Query that lists ALL product variations, and supplies it to the CALLBACK in the Meta Box list.
Separately, it's also easy to write custom code for the edit screen that that accesses the $POST data for the currently loaded product, and (for example) displays it somewhere.
However I can't seem to link those two bits of logic together, and it feels like an execution order issue (unless I'm missing something obvious).
I need the snippet that loads the custom query to run AFTER the $POST object is available, but BEFORE Meta Box populates its select fields.
I'm using WPCodeBox so have a good level of control over the timing of the snippet execution, but have tried most of the available options without success.
Has anyone got any experience with doing this and could point me in the right direction?
Many thanks in advance for all help and advice!