• Resolved jhwarp

    (@jhwarp)


    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)
  • Plugin Author RazyRx

    (@razyrx)

    Hello,

    In products plugin use post meta with names min_quantity and max_quantity.
    In product variations plugin use post meta with names min_quantity_var and max_quantity_var.

    Regards,
    Oleg

    Thread Starter jhwarp

    (@jhwarp)

    Thanks for not only giving meta keys, but also where they are used. This helps out a lot!

    Plugin Author RazyRx

    (@razyrx)

    Hello,

    What do you mean with “where they are used”?
    Do you need php file name where it is used or place on page where you can change it?

    Regards,
    Oleg

    Thread Starter jhwarp

    (@jhwarp)

    No no, you misunderstood, I wasn’t being clear enough ??

    I was saying thank you for pointing out in which plugin they were used (in products plugin and in variations plugin). This helped me out a lot. Thank you

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘update variations via php’ is closed to new replies.