Kibou
Forum Replies Created
-
Okay, I build sometime that works. But I need a hook that runs best after the scheudle export has been send:
add_action( ‘XXX_RIGHT_AFTER_SCHEDULED_EXPORT_XXX’, ‘auto_update_orders_status_from_processing_to_completed’);
P.S.: If this can be simplifed, please let me know:
/* ——— Enable Custom Variables in Query for orders ——– */
function handle_custom_query_var( $query, $query_vars ) {
if ( ! empty( $query_vars[‘_woo_cd_exported’] ) ) {
$query[‘meta_query’][] = array(
‘key’ => ‘_woo_cd_exported’,
‘value’ => esc_attr( $query_vars[‘_woo_cd_exported’] ),
);
}return $query;
}
add_filter( ‘woocommerce_order_data_store_cpt_get_orders_query’, ‘handle_custom_query_var’, 10, 2 );/* ——– Get Orders ——- */
function auto_update_orders_status_from_processing_to_completed(){
// Get all current “processing” customer orders
$processing_orders = wc_get_orders( $args = array(
‘post_status’ => ‘wc-processing’,
‘_woo_cd_exported’ => ‘1’,
) );
if(!empty($processing_orders))
foreach($processing_orders as $order)
$order->update_status( ‘completed’, ‘By robot ‘ . date(“d.m.y h:i:s”));
}Version 2.0
Everything is up to date
Yes ??
Forum: Plugins
In reply to: [Woocommerce Smart Export] German and the decimal . ,Hey Themology,
sorry for the late answer. I tried to find a way, however (since I am not a coder) I could not make it.
Do you have a piece of code I can enter?
P.S.: Is there a way to also export variants in the same line?
T-Shirt Blue
T-Shirt Red
or so?Thank you!