Remove related products from product page in WooCommerce

If you want to remove related products from product page in WooCommerce then place the following code in your functions.php file.

function wc_remove_related_products( $args ) {
	return array();
}
add_filter('woocommerce_related_products_args','wc_remove_related_products', 10); 

Have any doubt, then comment here!

How to get number of item in WooCommerce cart?

If you want to get number of items in a WooCommerce cart then you can place the following code in your file.

global $woocommerce;
$count=$woocommerce->cart->cart_contents_count;

Here $count having total number of items in your WooCommerce cart.
Have any doubt, then comment here!

Get all orders of a single customer in WooCommerce by email ID

You can fetch all WooCommerce orders of a single customer by different parameter.
Here you can find all orders of a customer by email id.
Use the following to fetch all orders of a single customer in WooCommerce by email ID.
You have to replace customer email id instead of ‘CUSTOMER_EMAIL_ID_HERE’.

$billing_email='CUSTOMER_EMAIL_ID_HERE';
$customer_orders = get_posts( array(
                    'meta_key'    => '_billing_email',
                    'meta_value'  => $billing_email,
                    'post_type'   => 'shop_order',
                    'post_status' => array_keys( wc_get_order_statuses() ),
                    'numberposts' => -1
                ));

Have any doubt, then comment here!

Get all orders of a single customer in WooCommerce by user ID

You can fetch all WooCommerce orders of a single customer by different parameter.
Here you can find all WooCommerce orders of a customer by user id.
Use the following to fetch all orders of a single customer in WooCommerce by user ID.
You have to replace customer id instead of ‘CUSTOMER_USER_ID_HERE’.

$user_id='CUSTOMER_USER_ID_HERE';
$customer_orders = get_posts( array(
                    'meta_key'    => '_customer_user',
                    'meta_value'  => $user_id,
                    'post_type'   => 'shop_order',
                    'post_status' => array_keys( wc_get_order_statuses() ),
                    'numberposts' => -1
                ));

Have any doubt, then comment here!