Having some really issue with a bit of custom code,
I'm using the Woocommerce Booking plugin along with the Woocommerce Advanced Export plugin.
My aim is to only export reservations for (today), Ive got the export table and everything setup but whenever I try to export the orders its giving me all the order,I don't need them all I just need them for (today)
I found some useful code online and I thought I code use it to base my code on, Ive tried to edit/change the code to make it suit my needs. However whenever I run the code Ive created it give me an error (Screenshot Below)
The code I've created is as follows:
// export only orders with total > 10
add_filter( 'woe_order_export_started', function ( $order_id ) {
$order = new WC_Order($order_id);
return ($order->get_booking_field_start_date() = str_replace( '{today}', $today, $settings));
});
I'm not sure if Im asking it to use the correct field or not so Ive also tried this version of the code:
// export only orders with total > 10
add_filter( 'woe_order_export_started', function ( $order_id ) {
$order = new WC_Order($order_id);
return ($order->woe_get_order_product_value_booking_start_date() = str_replace( '{today}', $today, $settings));
});
I've create these two bits of code by reading and looking at other code which I found online here
I'm not too sure how to fix my code for it to do what im wanting it to do,
If anyone is able to help, it would be very appreciated.