Skip to content

Instantly share code, notes, and snippets.

@Antoinebr
Created September 8, 2015 11:44
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save Antoinebr/d650890a9a5109713de3 to your computer and use it in GitHub Desktop.
Save Antoinebr/d650890a9a5109713de3 to your computer and use it in GitHub Desktop.
<?php
global $woocommerce;
$args = array(
'post_type' => 'shop_order',
'post_status' => 'publish',
'posts_per_page' => -1,
'tax_query' => array(
array(
'taxonomy' => 'shop_order_status',
'field' => 'slug',
'terms' => array('completed')
)
)
);
$loop = new WP_Query( $args );
while ( $loop->have_posts() ) : $loop->the_post();
$order_id = $loop->post->ID;
$order = new WC_Order($order_id);
echo $order->get_formatted_shipping_address();
// toutes les vals dispo voir https://docs.woothemes.com/wc-apidocs/class-WC_Order.html
endwhile;
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment