the answer for all question about Oxygen Builder plugin and WordPress

Trying to use dynamic data > php function to call custom woo variation fields. H


Trying to use dynamic data > php function to call custom woo variation fields. Here is what I have so far….It is working, but when I select a different variation the value doesn’t update….any ideas on how I can finalize this? Hope this code can be useful for someone.

‘product_variation’,
‘post_status’ => array( ‘private’, ‘publish’ ),
‘numberposts’ => -1,
‘orderby’ => ‘menu_order’,
‘order’ => ‘asc’,
‘post_parent’ => get_the_ID() // get parent post-ID
);
$variations = get_posts( $args );
foreach ( $variations as $variation ) {
$variation_ID = $variation->ID;
$product_variation = new WC_Product_Variation( $variation_ID );
return get_post_meta( $variation_ID , $varfield, true );
}
}


Source

Leave A Reply

Your email address will not be published.

Oxyrealm Docs