add_action( 'plugins_loaded', function() { if ( ! function_exists( 'hivepress' ) ) { return; } $marketplace = hivepress()->marketplace; if ( ! $marketplace ) { return; } remove_action( 'woocommerce_order_status_changed', [ $marketplace, 'update_order_status' ], 10 ); add_action( 'woocommerce_order_status_changed', 'loa_fast_marketplace_status', 10, 4 ); }, 100 ); function loa_fast_marketplace_status( $order_id, $old_status, $new_status, $order ) { $vendor_id = $order->get_meta( 'hp_vendor' ); if ( ! $vendor_id ) { return; } $start = microtime( true ); // ONLY test the vendor email. if ( in_array( $new_status, [ 'processing', 'completed', 'refunded' ], true ) ) { $user = \HivePress\Models\User::query()->get_by_id( get_post_field( 'post_author', $order->get_id() ) ); if ( $user ) { $email_args = [ 'recipient' => $user->get_email(), 'tokens' => [ 'user' => $user, 'user_name' => $user->get_display_name(), 'order_number' => '#' . $order->get_id(), 'order_amount' => hivepress()->woocommerce->format_price( hivepress()->marketplace->get_order_total( $order ) ), 'order_url' => hivepress()->router->get_url( 'order_edit_page', [ 'order_id' => $order->get_id() ] ), ], ]; $email_start = microtime( true ); $email = new \HivePress\Emails\Order_Complete( $email_args ); $email->send(); error_log( sprintf( '[LOA HP EMAIL TEST] %.4fs', microtime( true ) - $email_start ) ); } } error_log( sprintf( '[LOA HP STATUS TEST] TOTAL %.4fs', microtime( true ) - $start ) ); }Tag: Nature - Page 3 - LOA TEAM

Nature

Showing 21-30 of 33 results
Show Map
Home
Events
Activities
Travel
Account

Sign In

Register

Reset Password

Please enter your username or email address, you will receive a link to create a new password via email.