user_email ); $first_name = esc_js( $current_user->user_firstname ); $last_name = esc_js( $current_user->user_lastname ); // Try to get billing info if WooCommerce is active if ( class_exists( 'WooCommerce' ) ) { $customer = new WC_Customer( $current_user->ID ); $phone = esc_js( $customer->get_billing_phone() ); $city = esc_js( $customer->get_billing_city() ); $state = esc_js( $customer->get_billing_state() ); $zip = esc_js( $customer->get_billing_postcode() ); $country = esc_js( $customer->get_billing_country() ); } else { $phone = $city = $state = $zip = $country = ''; } } else { // If the user isn’t logged in, send blank data (still works) $email = $first_name = $last_name = $phone = $city = $state = $zip = $country = ''; } ?>