Im trying to get orders in WooCommerce (ideally through wc_get_orders) where the coupon code "some_code" was used.
My try:
function get_orders_with_coupon($coupon){
$customer_orders = wc_get_orders(array(
'limit' => -1,
'coupon' => $coupon
));
return $customer_orders;
}
function get_orders_with_coupon($coupon){
$customer_orders = wc_get_orders(array(
'limit' => -1,
'coupon' => $coupon
));
return $customer_orders;
}
Only one code is used in Woo orders.