I have a WooCommerce site. The users need to log in to purchase. Users have added their details to their account directly (Dashboard > Users). The user role is Customer.
I need to fetch the company address from the customer profile. I have used the below code:
<?php $users= get_user_meta( $item['user_id'], 'billing_company', true );
echo $users;
?>
But it is now showing the company address. it is not showing anything.
What am I doing wrong there?
Related
I need to send the reset email to user and admin. In this thread there is a solution:
How to send details to users registered to admin as an email in wordpress?
But I don't know where and how I have to put the admin email or the user_admin in the field "to"
wp_mail(
$wp_new_user_notification_email['to'],
wp_specialchars_decode( sprintf( $wp_new_user_notification_email['subject'], $blogname ) ),
$wp_new_user_notification_email['message'],
$wp_new_user_notification_email['headers']
Thank you very much for your help.
I am looking for a snippet to completely disable the email notification sent out to users when an Admin changes their email in WordPress.
For context, it's this email:
[site name] Email Changed
Hi user name,
This notice confirms that your email address on [sitename] was changed to[ useremail].
If you did not change your email, please contact the Site Administrator at
[admin email]
Found this with a quick google 😉
WP Docs: https://developer.wordpress.org/reference/hooks/send_email_change_email/
<?php
// functions.php
add_filter( 'send_email_change_email', '__return_false' );
My Woocommerce shop allows to buy for anonymous customers without email address.
One of allowed payment method is online card payment.
I added blind copy to notification mail to allow admin know about payment:
add_filter('woocommerce_email_headers', function ($header, $email_id, $order) {
if ('customer_processing_order' === $email_id) {
$header .= "BCC: MyShopAdmin <myshopadmin#domain.net>";
}
return $header;
}, 10, 3);
Works great when customer entered email during checkout process.
None of email when customer not entered email address. Yes, it's reasonable - no email address = no email.
But I want to inform shop admin about successful payment even no customer email address entered. How to do it?
Guess exists some point in Woocommerce where I can analyze email headers early before mail send init. I did not find any hooks / filters for that.
Does anybody can help me?
instead of adding filter at woocommerce_email_headers why dont you try woocommerce_payment_complete hook
This would facilitate shop admin about successful payment event
add_action( 'woocommerce_payment_complete', 'payment_complete' );
I have a client who wants her WordPress users to be able to retrieve their username/password even in the unlikely event, that they have forgotten both their username, password AND email address. Instead, they want the users to be able to retrieve their login info based on user meta data.
Users are created through a CSV-import, and their private email addresses are stored under a 'user_private_email' user_meta key. Users are invited to join the site via this mail address, but when they log in the first time, they are prompted to enter their work email. So this overwrites $user_email in wp_user.
My question is: How do I get WP to also check the get_user_meta($user_id, 'user_private_email', true); variable, and use this to resend the login info?
I am working on a wordpress site. I am selling a digital course on it.
Users interested in the course will pay locally via bank and send me payment details. so after i confirm their payment i will like to add their email and phone number also generate a unique code like password to append the email.
So they can enter their email and the password i gave to them to enter part of the site where they have access to the course materials.
$password = wp_generate_password( 8 );
This function creates password randomly