Shehryar Tanoli
Forum Replies Created
-
Forum: Plugins
In reply to: [WooCommerce] Replace WooCommerce email registration with phone number.@fernashes Thanks for your response. I have gone through the above link already but it does not meet my requirements I don’t want email field and password field on registration form just the phone number and OTP.
For the OTP I have already written my custom code and getting the OTPs as required..Forum: Fixing WordPress
In reply to: Authenticate WooCommerce custom login fields.Below is the solution I found. It might be helpful for someone else
//login authentication
function login_auth($user)
{
$login_otp = wc()->session->get(‘login_otp’);if( empty($_POST[‘otp_login_field’])){
remove_action(‘authenticate’, ‘wp_authenticate_username_password’, 20);
$user = new WP_Error( ‘denied’, __(” Otp field is empty “));
}
elseif($_POST[‘otp_login_field’] != $login_otp){
remove_action(‘authenticate’, ‘wp_authenticate_username_password’, 20);
$user = new WP_Error( ‘denied’, __(” Invalid otp “));}
return $user;
}//login authentication ends hereadd_filter(‘woocommerce_process_login_errors’, array($this,’login_auth’),10,3);
Forum: Fixing WordPress
In reply to: Authenticate WooCommerce custom login fields.@littlepackage Thanks for your response I have found a solution..
Forum: Plugins
In reply to: [WooCommerce] Set WooCommerce session for 2 minutes.@rynald0s Thanks for your response. Can you please help me with other stuff. I want to disbale woocommerce default registration email field i want to register user via their mobile number..
Forum: Developing with WordPress
In reply to: Adding Anchor Tag@bcworkz This is how i am able to do it.Now i am having trouble to go to a specific permalink .Permalink in the anchor tag is not working properly it does not takes me to the specific post rather it shows all posts again without styling which i have applied..
<?php if(strlen($feedback)<200) { echo do_shortcode("<b>Feedback </b>: ". "{$feedback}"); } elseif(strlen($feedback)>200) { $feedback = substr(get_post_meta(get_the_ID(),'feedback',true),0,200); echo do_shortcode("<b>Feedback </b>: ". "{$feedback}"); ?> <div class="anchor"> <a>">"> ...Read More</a> </div>
- This reply was modified 4 years ago by Shehryar Tanoli.
- This reply was modified 4 years ago by Shehryar Tanoli.
- This reply was modified 4 years ago by bcworkz. Reason: code fixed