Skip to content

Instantly share code, notes, and snippets.

@crgeary
Created March 11, 2021 13:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save crgeary/0216f8380e1e76f1d7b8d638c009c559 to your computer and use it in GitHub Desktop.
Save crgeary/0216f8380e1e76f1d7b8d638c009c559 to your computer and use it in GitHub Desktop.
<?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