update variations via php
-
This plugin looks perfect for my use case. I am abandoning some (premium) plugins that does not offer the functionality that this does. So thanks a lot.
I want to find out, is there a way that I can update min quantity for product variations via php? Something like update_post_meta perhaps? The reason why I want to do this, is because I have the data in another plugin, but want to transfer it over to yours without manually changing each variation. So I’m doing something like: `
$args = array( 'post_type' => 'product', 'posts_per_page' => -1, ); $loop = new WP_Query( $args ); while ( $loop->have_posts() ) : $loop->the_post(); global $product; $min_value = get_post_meta(get_the_id(), 'old_plugin_meta_for_min', true ); if ($min_value) { // update_post_meta( get_the_id(), 'berocket_min_quantity', $min_value ); } endwhile; wp_reset_query();
This works 100% fine for simple products, but is this possible with variations?
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘update variations via php’ is closed to new replies.