Change the order number to date based and reset every 24 hours.
In the functions.php add below between <?php and ?>
add_filter( 'woocommerce_order_number', 'change_woocommerce_order_number' ); function change_woocommerce_order_number( $order_id ) { global $wpdb; $prefix = ' / '; $order = wc_get_order( $order_id ); $order_date = $order->get_date_created(); $date_created = $order_date->date( 'Y-m-d' ); $query = "SELECT ID FROM {$wpdb->prefix}posts WHERE post_date LIKE '%".$date_created."%' AND post_type='shop_order' ORDER BY ID "; $result = $wpdb->get_results( $query ); $count = 0; foreach( $result as $index => $id ) { if( strval($order_id) == $id->ID ) { $count = $index + 1; break; } } $new_order_id = $count . $prefix .$date_created; return $new_order_id; }
The other plugin may still use the system order ID, If you want to use this format in other plugins, you will need to add this function in that plugin file and change the relevant variable.
remove email on checkout page
in the functions.php add below between <?php and ?>
function _custom_checkout_fields( $address_fields ) { unset( $address_fields['billing']['billing_email'] ); return $address_fields; } add_filter( 'woocommerce_checkout_fields', '_custom_checkout_fields' ,20, 1 );
if you just need to hide it just for user logged in:
function _custom_checkout_fields( $address_fields ) {
if( is_user_logged_in() ) {
unset( $address_fields[‘billing’][‘billing_email’] );
}
return $address_fields;
}
add_filter( ‘woocommerce_checkout_fields’, ‘_custom_checkout_fields’ ,20, 1 );