TMP fixer for Orders

0.0/5
<?php
add_action('woocommerce_after_register_post_type', 'test_create_product_variation');
function test_create_product_variation(){
$query = new WC_Order_Query( array(
    'limit' => 10,
	'offset' => 90,
    'orderby' => 'date',
    'order' => 'DESC',
) );
$orders = $query->get_orders();
//$posts = get_posts($args);
error_log(count($orders));
foreach ($orders as $post) {
	if (empty( get_post_meta( $post->ID, 'fakturoid_user_id', true ))){
		Woo_Fakturoid::get_instance()->invoice($post->ID);
	}
}
}

Comments and reviews

{{ reviewsTotal }} Review
{{ reviewsTotal }} Reviews
{{ options.labels.newReviewButton }}
{{ userData.canReview.message }}

Description

This snippet was fetched automatically from WPDistro.cz projects.

Author

Tags

This snippet is untagged