Skip to content

Instantly share code, notes, and snippets.

@crgeary
Created Mar 11, 2021
Embed
What would you like to do?
<?php
add_action('init', function () {
$orders = wc_get_orders([
'date_created' => '2020-11-01...2020-11-30',
'limit' => 50000,
]);
$order = wc_get_order(16118)->get_items();
echo '<pre>';
foreach ($items as $item) {
echo $item->get_product_id();
}
exit;
});
<?php
add_action('init', function () {
$orders = wc_get_orders([
'date_created' => '2020-11-23...2020-11-30',
'limit' => 50000,
]);
$order = wc_get_order(16118)->get_items();
echo '<pre>';
foreach ($items as $item) {
echo $item->get_product_id();
}
exit;
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment