Support » Plugin: OTP Login Woocommerce & Gravity Forms » Field Phone
Field Phone
-
Hi!
I am using the plugin but the field phone isnt add to the register form, as the area code did, what can I modify?
this is:
https://ibb.co/NyVhsxG
thanks!!
-
Sorry, is it possible aplly the field to the register of WC too?
Yes, it should appear by default in your woocommerce registration form.
If it isn’t appearing, kindly share your website link.
For Login/Signup popup plugin, its a separate add on .Thanks! In the registration form of woocommerce appears but not in the registra vendor ( WCFM).
May be i can add the field phone with any shortcode?Yes, there is a function available to generate input field
xoo_ml_get_phone_input_field()
You can turn it into shortcode, paste this code in your functions.phpadd_shortcode( 'xoo_ml_phone_field', 'xoo_ml_cu_phone_field_shortcode' ); function xoo_ml_cu_phone_field_shortcode( $atts ) { return xoo_ml_get_phone_input_field( array(), true ); }
Now use
[xoo_ml_phone_field]
in your formGreat! this works but it not verified when i register.
I added to the code of the button submit of to be vendor of WCFM the class *xoo-ml-phone-form-btn* but it didnt work, only if i add it to the ID but it only verified the number but not did the register the user.
thanks for your help!!The code of vendor:
`<div id=”wcfm_membership_registration_submit” class=”wcfm_form_simple_submit_wrapper”>
<?php if( wcfm_is_allowed_membership() ) { ?>
<input type=”submit” name=”save-data” value=”<?php if( $user_id ) { _e( ‘Confirm’, ‘wc-multivendor-membership’ ); } else { _e( ‘Register’, ‘wc-multivendor-membership’ ); } ?>” id=”wcfm_membership_register_button” class=”wcfm_submit_button xoo-ml-phone-form-btn” />`-
This reply was modified 2 years, 10 months ago by
jennifersanchez.
-
This reply was modified 2 years, 10 months ago by
jennifersanchez.
Great. We got the form to enable verification.
Now we need to tell the plugin that its a user registration form, so that we can save the phone number as user meta.
There is a filter availablexoo_ml_user_register_phone_forms
.
This filter needs a form input name, it could be any of your inputs.
Your form has<input type=”submit” name=”save-data”>
So the filter would beadd_filter( 'xoo_ml_user_register_phone_forms', function( $forms ){ $forms[] = 'save-data'; return $forms; } );
Please add it to your functions.php
Looks like the code you have shared above has two jobs, “Register” & something with the “Confirmation”. If both does the registration you can skip the below part, Otherwise you need to provide exclusive input only for registration.
Add this to your form<?php if( !$user_id ): ?> <input type="hidden" name="xoo-ml-cu-form-register" value="1"> <?php endif; ?>
The filter would become
add_filter( 'xoo_ml_user_register_phone_forms', function( $forms ){ $forms[] = 'save-data'; return $forms; } );
Hi there! Thanks for the help.
I tried in several ways to use the code, without success.
this error appears in console and sends the sms but then the page is loading without success.
Might an action to the button be necessary to recognize?
it does not even take it as an obligation to complete the field.
Thank you very much for your help!i share to you the code of form https://codeshare.io/2jwEmD
Hello @jennifersanchez
So, try this
1) Add attributemethod="post"
to your form tag.
How to2) Add this hidden input
<input type="hidden" name="xoo-ml-cu-form-register" value="1">
3) Add this to your functions.php
add_filter( 'xoo_ml_user_register_phone_forms', function( $forms ){ $forms[] = 'xoo-ml-cu-form-register'; return $forms; } );
I have tried to help you to the best of my knowledge.
Its your custom form & I do not know, how it behaves in the back-end. You have also not shared your website link.
There is nothing more left to try, hope the above steps work for you.Hi! I have been trying for hours and came to the conclusion:
all this option when i used it bring this error: https://ibb.co/C0sFSNB
xoo-ml-cu-form-register
xoo-ml-phone-form
class xoo-el-action-btn (in the buttom make it be a field requiered)only works the register (without verify of phone) when i added this [xoo_ml_phone_field].
i tried with add the class to the button ant it didn t work..
if you have any other idea i will thanks you!! -
This reply was modified 2 years, 10 months ago by
- The topic ‘Field Phone’ is closed to new replies.