huzaifa0300
Forum Replies Created
-
Yes, The issue has been fixed. There was a bug in a plugin that I have uninstalled now. thanks for your support : )
Forum: Plugins
In reply to: [WooCommerce] Phone Number-Based User backend Identification in WooCommerceHi WooCommerce Support Team,
Thank you for your response. I wanted to let you know that I have successfully resolved the issue with making the email field optional during checkout using custom code. Here’s a brief overview of how it works:
Custom PHP Code Implementation:
// Make email field optional add_filter( 'woocommerce_billing_fields', 'make_email_field_optional' ); function make_email_field_optional( $fields ) { $fields['billing_email']['required'] = false; return $fields; } // Identify and log in user by phone number or email add_action( 'woocommerce_before_checkout_process', 'identify_and_log_in_user_by_phone_number_or_email' ); function identify_and_log_in_user_by_phone_number_or_email() { $phone_number = $_POST['billing_phone']; $email = $_POST['billing_email']; // Check if phone number is provided if ( ! empty( $phone_number ) ) { $user_query = new WP_User_Query( array( 'meta_query' => array( array( 'key' => 'billing_phone', 'value' => $phone_number, 'compare' => '=' ) ) ) ); $users = $user_query->get_results(); if ( $users ) { $user = $users[0]; wp_set_current_user( $user->ID ); wp_set_auth_cookie( $user->ID ); do_action( 'wp_login', $user->user_login, $user ); } else { // Create a new user if phone number is not found $user_data = array( 'user_login' => $phone_number, 'role' => 'customer' ); if ( ! empty( $email ) ) { $user_data['user_email'] = $email; } $user_id = wp_insert_user( $user_data ); if ( $user_id ) { update_user_meta( $user_id, 'billing_phone', $phone_number ); if ( ! empty( $email ) ) { update_user_meta( $user_id, 'billing_email', $email ); } wp_set_current_user( $user_id ); wp_set_auth_cookie( $user_id ); do_action( 'wp_login', $user_data['user_login'], $user ); } } } // Check if email is provided if ( ! empty( $email ) ) { $user_query = new WP_User_Query( array( 'meta_query' => array( array( 'key' => 'user_email', 'value' => $email, 'compare' => '=' ) ) ) ); $users = $user_query->get_results(); if ( $users ) { $user = $users[0]; wp_set_current_user( $user->ID ); wp_set_auth_cookie( $user->ID ); do_action( 'wp_login', $user->user_login, $user ); } } // Display error messages if phone number and email are empty if ( empty( $phone_number ) && empty( $email ) ) { wc_add_notice( __( 'Please enter your phone number or email address.', 'text-domain' ), 'error' ); } }
Advantages of Custom Code:
- Consistent User Identification: Unlike using checkout field editor plugins which might treat every customer as a new customer (due to the lack of record consistency), this code ensures that returning customers are identified properly, whether they use a phone number or email.
- Improved User Experience: The system logs in returning users automatically based on their phone number or email, creating a seamless checkout experience.
- Flexibility: Users can check out with either a phone number or email, providing a more flexible approach.
For anyone needing similar functionality, they can use this custom code. If there are any issues or additional support is needed, please feel free to contact me through my website: Huzaifa Qureshi.
Thank you!
Best regards,
Huzaifa QureshiForum: Plugins
In reply to: [WooCommerce] Phone Number-Based User backend Identification in WooCommerceHi Shameen,
Thank you for your response and suggestion to use the “Digits: WordPress Mobile Number Signup and Login” plugin. However, I don’t intend to use SMS verification or OTP functionality. My goal is simpler:
I want to keep the email field optional during checkout, but I’m facing an issue where, when a customer doesn’t provide an email, each order is treated as a new one, even for returning customers. This breaks the ability to track customer data.
What I need is for user backend identification to be done via phone number instead of email, so that even when the email field is optional or left blank, returning customers are recognized by their phone number, and their previous data (such as order history) is maintained.
Is there any solution or custom code to allow this kind of phone number-based identification without relying on SMS or OTPs?
Looking forward to your guidance!
Thank you,
Huzaifa QureshiForum: Plugins
In reply to: [WooCommerce] Woocommerce Not Sending any type of Email to CustomerI wanted to let you know that the mail-sending issue has been resolved after setting up the SMTP. Thank you for your help!
Forum: Plugins
In reply to: [WooCommerce] Woocommerce Not Sending any type of Email to CustomerThank you for the recommendation.
If I switch to using a business email instead of a standard one, would I still need to set up SMTP, or would using a business email resolve this issue on its own?
Looking forward to your advice.
Forum: Plugins
In reply to: [WooCommerce] Woocommerce Not Sending any type of Email to CustomerThank you for the suggestion. I’ll go ahead and set up an SMTP provider to see if that resolves the email issue.
However, there’s another concern I’d like to address. Currently, when a user registers on the site by simply entering their email, they are immediately redirected to the ‘My Account’ page without any email verification. Ideally, I’d like the process to include email verification before they can access the ‘My Account’ page. Could you advise on how to implement this?
Thanks for your continued support.
link: https://eleganzecosmetics.com/my-account/Forum: Plugins
In reply to: [WooCommerce] Woocommerce Not Sending any type of Email to CustomerHere it is:
WordPress Environment<br><br>WordPress address (URL): https://eleganzecosmetics.com<br>Site address (URL): https://eleganzecosmetics.com<br>WC Version: 9.2.2<br>Legacy REST API Package Version: The Legacy REST API plugin is not installed on this site.<br>Action Scheduler Version: ? 3.8.1<br>Log Directory Writable: ?<br>WP Version: 6.6.1<br>WP Multisite: –<br>WP Memory Limit: 768 MB<br>WP Debug Mode: –<br>WP Cron: ?<br>Language: en_US<br>External object cache: – Server Environment<br><br>Server Info: Apache<br>PHP Version: 7.4.33<br>PHP Post Max Size: 256 MB<br>PHP Time Limit: 120<br>PHP Max Input Vars: 3000<br>cURL Version: 8.2.1<br>OpenSSL/3.1.1<br><br>SUHOSIN Installed: –<br>MySQL Version: 8.0.36-28<br>Max Upload Size: 256 MB<br>Default Timezone is UTC: ?<br>fsockopen/cURL: ?<br>SoapClient: ?<br>DOMDocument: ?<br>GZip: ?<br>Multibyte String: ?<br>Remote Post: ?<br>Remote Get: ? Database<br><br>WC Database Version: 9.2.2<br>WC Database Prefix: kru_<br>Total Database Size: 94.71MB<br>Database Data Size: 88.71MB<br>Database Index Size: 6.00MB<br>kru_woocommerce_sessions: Data: 0.02MB + Index: 0.02MB + Engine InnoDB<br>kru_woocommerce_api_keys: Data: 0.02MB + Index: 0.03MB + Engine InnoDB<br>kru_woocommerce_attribute_taxonomies: Data: 0.02MB + Index: 0.02MB + Engine InnoDB<br>kru_woocommerce_downloadable_product_permissions: Data: 0.02MB + Index: 0.06MB + Engine InnoDB<br>kru_woocommerce_order_items: Data: 0.02MB + Index: 0.02MB + Engine InnoDB<br>kru_woocommerce_order_itemmeta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB<br>kru_woocommerce_tax_rates: Data: 0.02MB + Index: 0.06MB + Engine InnoDB<br>kru_woocommerce_tax_rate_locations: Data: 0.02MB + Index: 0.03MB + Engine InnoDB<br>kru_woocommerce_shipping_zones: Data: 0.02MB + Index: 0.00MB + Engine InnoDB<br>kru_woocommerce_shipping_zone_locations: Data: 0.02MB + Index: 0.03MB + Engine InnoDB<br>kru_woocommerce_shipping_zone_methods: Data: 0.02MB + Index: 0.00MB + Engine InnoDB<br>kru_woocommerce_payment_tokens: Data: 0.02MB + Index: 0.02MB + Engine InnoDB<br>kru_woocommerce_payment_tokenmeta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB<br>kru_woocommerce_log: Data: 0.02MB + Index: 0.02MB + Engine InnoDB<br>kru_actionscheduler_actions: Data: 0.06MB + Index: 0.11MB + Engine InnoDB<br>kru_actionscheduler_claims: Data: 0.02MB + Index: 0.02MB + Engine InnoDB<br>kru_actionscheduler_groups: Data: 0.02MB + Index: 0.02MB + Engine InnoDB<br>kru_actionscheduler_logs: Data: 0.02MB + Index: 0.03MB + Engine InnoDB<br>kru_commentmeta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB<br>kru_comments: Data: 0.05MB + Index: 0.09MB + Engine InnoDB<br>kru_e_events: Data: 0.02MB + Index: 0.02MB + Engine InnoDB<br>kru_e_notes: Data: 0.02MB + Index: 0.17MB + Engine InnoDB<br>kru_e_notes_users_relations: Data: 0.02MB + Index: 0.05MB + Engine InnoDB<br>kru_e_submissions: Data: 0.02MB + Index: 0.27MB + Engine InnoDB<br>kru_e_submissions_actions_log: Data: 0.02MB + Index: 0.11MB + Engine InnoDB<br>kru_e_submissions_values: Data: 0.02MB + Index: 0.03MB + Engine InnoDB<br>kru_links: Data: 0.02MB + Index: 0.02MB + Engine InnoDB<br>kru_nx_entries: Data: 0.02MB + Index: 0.03MB + Engine InnoDB<br>kru_nx_posts: Data: 0.02MB + Index: 0.05MB + Engine InnoDB<br>kru_nx_stats: Data: 0.02MB + Index: 0.02MB + Engine InnoDB<br>kru_options: Data: 5.13MB + Index: 0.09MB + Engine InnoDB<br>kru_pimwick_gift_card: Data: 0.02MB + Index: 0.02MB + Engine InnoDB<br>kru_pimwick_gift_card_activity: Data: 0.02MB + Index: 0.02MB + Engine InnoDB<br>kru_postmeta: Data: 51.52MB + Index: 3.03MB + Engine InnoDB<br>kru_posts: Data: 30.52MB + Index: 0.44MB + Engine InnoDB<br>kru_sbi_feeds: Data: 0.02MB + Index: 0.02MB + Engine InnoDB<br>kru_smush_dir_images: Data: 0.02MB + Index: 0.03MB + Engine InnoDB<br>kru_term_relationships: Data: 0.02MB + Index: 0.02MB + Engine InnoDB<br>kru_term_taxonomy: Data: 0.02MB + Index: 0.03MB + Engine InnoDB<br>kru_termmeta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB<br>kru_terms: Data: 0.02MB + Index: 0.03MB + Engine InnoDB<br>kru_usermeta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB<br>kru_users: Data: 0.02MB + Index: 0.05MB + Engine InnoDB<br>kru_wc_admin_note_actions: Data: 0.05MB + Index: 0.02MB + Engine InnoDB<br>kru_wc_admin_notes: Data: 0.06MB + Index: 0.00MB + Engine InnoDB<br>kru_wc_category_lookup: Data: 0.02MB + Index: 0.00MB + Engine InnoDB<br>kru_wc_customer_lookup: Data: 0.02MB + Index: 0.03MB + Engine InnoDB<br>kru_wc_download_log: Data: 0.02MB + Index: 0.03MB + Engine InnoDB<br>kru_wc_order_addresses: Data: 0.02MB + Index: 0.06MB + Engine InnoDB<br>kru_wc_order_coupon_lookup: Data: 0.02MB + Index: 0.03MB + Engine InnoDB<br>kru_wc_order_operational_data: Data: 0.02MB + Index: 0.03MB + Engine InnoDB<br>kru_wc_order_product_lookup: Data: 0.02MB + Index: 0.06MB + Engine InnoDB<br>kru_wc_order_stats: Data: 0.02MB + Index: 0.05MB + Engine InnoDB<br>kru_wc_order_tax_lookup: Data: 0.02MB + Index: 0.03MB + Engine InnoDB<br>kru_wc_orders: Data: 0.02MB + Index: 0.11MB + Engine InnoDB<br>kru_wc_orders_meta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB<br>kru_wc_product_attributes_lookup: Data: 0.02MB + Index: 0.02MB + Engine InnoDB<br>kru_wc_product_download_directories: Data: 0.02MB + Index: 0.02MB + Engine InnoDB<br>kru_wc_product_meta_lookup: Data: 0.02MB + Index: 0.11MB + Engine InnoDB<br>kru_wc_rate_limits: Data: 0.02MB + Index: 0.02MB + Engine InnoDB<br>kru_wc_reserved_stock: Data: 0.02MB + Index: 0.00MB + Engine InnoDB<br>kru_wc_tax_rate_classes: Data: 0.02MB + Index: 0.02MB + Engine InnoDB<br>kru_wc_webhooks: Data: 0.02MB + Index: 0.02MB + Engine InnoDB<br>kru_woo_shippment_provider: Data: 0.16MB + Index: 0.00MB + Engine InnoDB<br>kru_wpfm_backup: Data: 0.02MB + Index: 0.00MB + Engine InnoDB<br>kru_wpml_mails: Data: 0.02MB + Index: 0.03MB + Engine InnoDB Post Type Counts<br><br>attachment: 533<br>custom_css: 2<br>customize_changeset: 51<br>elementor_font: 1<br>elementor_icons: 1<br>elementor_library: 75<br>elementor-hf: 1<br>nav_menu_item: 128<br>page: 38<br>post: 31<br>product: 15<br>revision: 1695<br>shop_order: 91<br>shop_order_placehold: 4<br>wp_global_styles: 1<br>wp_navigation: 1<br>wpcode: 2 Security<br><br>Secure connection (HTTPS): ?<br>Hide errors from visitors: ? Active Plugins (10)<br><br>CMP - Coming Soon & Maintenance Plugin: by NiteoThemes – 4.1.13<br>Copy & Delete Posts: by Inisev – 1.4.8<br>Elementor: by Elementor.com – 3.23.4<br>Elementor Header & Footer Builder: by Brainstorm Force<br>Nikhil Chavan – 1.6.37<br><br>NotificationX: by WPDeveloper – 2.8.13<br>PRO Elements: by PROElements.org – 3.23.3<br>VamTam Elementor Integration (Jolie): by VamTam – 1.0.16<br>Advanced Shipment Tracking for WooCommerce: by zorem – 3.6.8<br>WooCommerce: by Automattic – 9.2.2<br>WP Mail Logging: by WP Mail Logging Team – 1.12.0 Inactive Plugins (5)<br><br>Elementor Pro: by Elementor.com – 3.20.3<br>PW WooCommerce Gift Cards: by Pimwick<br>LLC – 2.2<br><br>UpdraftPlus - Backup/Restore: by UpdraftPlus.Com<br>DavidAnderson – 1.24.4<br><br>VamTam Importers (E): by VamTam – 1.2.4<br>WP Reset: by WebFactory Ltd – 2.03 Settings<br><br>Legacy API Enabled: –<br>Force SSL: –<br>Currency: PKR (?)<br>Currency Position: left_space<br>Thousand Separator: ,<br>Decimal Separator: .<br>Number of Decimals: 0<br>Taxonomies: Product Types: external (external)<br>grouped (grouped)<br>pw gift card (pw-gift-card)<br>simple (simple)<br>variable (variable)<br><br>Taxonomies: Product Visibility: exclude-from-catalog (exclude-from-catalog)<br>exclude-from-search (exclude-from-search)<br>featured (featured)<br>outofstock (outofstock)<br>rated-1 (rated-1)<br>rated-2 (rated-2)<br>rated-3 (rated-3)<br>rated-4 (rated-4)<br>rated-5 (rated-5)<br><br>Connected to WooCommerce.com: –<br>Enforce Approved Product Download Directories: ?<br>HPOS feature enabled: ?<br>Order datastore: Automattic\WooCommerce\Internal\DataStores\Orders\OrdersTableDataStore<br>HPOS data sync enabled: – Logging<br><br>Enabled: ?<br>Handler: Automattic\WooCommerce\Internal\Admin\Logging\LogHandlerFileV2<br>Retention period: 30 days<br>Level threshold: –<br>Log directory size: 35 KB WC Pages<br><br>Shop base: #11 - /shop/<br>Cart: #12 - /cart/ - Contains the [woocommerce_cart] shortcode<br>Checkout: #13 - /checkout/ - Contains the [woocommerce_checkout] shortcode<br>My account: #14 - /my-account/<br>Terms and conditions: #988883 - /terms-and-conditions/ Theme<br><br>Name: OceanWP<br>Version: 3.5.9<br>Author URL: https://oceanwp.org/about-oceanwp/<br>Child Theme: ? – If you are modifying WooCommerce on a parent theme that you did not build personally we recommend using a child theme. See: How to create a child theme<br>WooCommerce Support: ? Templates<br><br>Overrides: oceanwp/woocommerce/cart/mini-cart.php<br>oceanwp/woocommerce/content-single-product.php<br>oceanwp/woocommerce/loop/loop-start.php<br>oceanwp/woocommerce/single-product/product-image.php<br>oceanwp/woocommerce/single-product/title.php Admin<br><br>Enabled Features: activity-panels<br>analytics<br>product-block-editor<br>coupons<br>core-profiler<br>customize-store<br>customer-effort-score-tracks<br>import-products-task<br>experimental-fashion-sample-products<br>shipping-smart-defaults<br>shipping-setting-tour<br>homescreen<br>marketing<br>mobile-app-banner<br>navigation<br>onboarding<br>onboarding-tasks<br>pattern-toolkit-full-composability<br>product-custom-fields<br>remote-inbox-notifications<br>remote-free-extensions<br>payment-gateway-suggestions<br>printful<br>shipping-label-banner<br>subscriptions<br>store-alerts<br>transient-notices<br>woo-mobile-welcome<br>wc-pay-promotion<br>wc-pay-welcome-page<br>launch-your-store<br><br>Disabled Features: experimental-blocks<br>minified-js<br>product-pre-publish-modal<br>settings<br>async-product-editor-category-field<br>product-editor-template-system<br><br>Daily Cron: ? Next scheduled: 2024-08-24 07:36:21 +00:00<br>Options: ?<br>Notes: 81<br>Onboarding: skipped Action Scheduler<br><br>Complete: 105<br>Oldest: 2024-07-24 00:49:07 +0000<br>Newest: 2024-08-23 20:33:04 +0000<br><br>Failed: 1<br>Oldest: 2024-04-23 07:39:05 +0000<br>Newest: 2024-04-23 07:39:05 +0000<br><br>Pending: 1<br>Oldest: 2024-08-23 20:57:16 +0000<br>Newest: 2024-08-23 20:57:16 +0000 Status report information<br><br>Generated at: 2024-08-23 20:34:20 +00:00<br>
Forum: Plugins
In reply to: [WooCommerce] Woocommerce Not Sending any type of Email to CustomerI’ve checked the WooCommerce email settings, and all necessary email notifications are enabled. Additionally, I’ve tested the WordPress email functionality using the WP Mail Logging plugin. The plugin shows that emails are being sent, but the WooCommerce-specific emails are not being received by users. I’ve also checked the spam folders, but the emails aren’t there either.
Given that WordPress emails are going through but WooCommerce emails are not reaching the recipients, it seems the issue is specific to WooCommerce. Would you recommend any further steps to resolve this?
Your assistance is greatly appreciated.