Month: May 2016

Remove woocommerce order notes from checkout page

For our customization want to remove woocommerce order notes section from checkout page then place the following snippet in functions.php within your theme folder!.

add_filter( 'woocommerce_checkout_fields' , 'remove_woocommerce_order_notes_from_checkout_page' );
function remove_woocommerce_order_notes_from_checkout_page( $fields ) {
     unset($fields['order']['order_comments']);
     return $fields;
}

Have any doubt, then comment here!

Get particular user meta data by user email address in WordPress

Here is a quick snippet to get particular user meta data by $email_address in WordPress. The following code will print particular user meta data for particular user.

$user = get_user_by( 'email', $email_address );
$user_id=$user->ID;
$key = 'you_key_name';
$single = true;
$meta_value = get_user_meta( $user_id, $key, $single );
echo $meta_value;

Have any doubt, then comment here!

Get all user meta data by user email address in WordPress

Here is a quick snippet to get all user meta data by email address in WordPress. The following code will print all user meta data for given email address in wordpress.

$user = get_user_by( 'email', $email_address );
$user_id=$user->ID;
$all_meta_for_user = get_user_meta( $user_id );
print_r( $all_meta_for_user );

Have any doubt, then comment here!