Home › Forums › WoodMart support forum › Age Verfication – Change Age
Age Verfication – Change Age
- This topic has 7 replies, 2 voices, and was last updated 2 years, 9 months ago by
Luke Nielsen.
-
AuthorPosts
-
June 1, 2022 at 9:33 am #380384
naldekhelParticipantHi there,
In settings >> AGE VERIFY POPUP. There is no field to change the needed age. Now it is (18), and I want it to be 21. Take a look at the attachment.
Thanks
Attachments:
You must be logged in to view attached files.June 1, 2022 at 3:09 pm #380514
Luke NielsenKeymasterHello,
The best way to change them is to use the “Loco Translate” plugin.
You can watch the video in our detailed documentation on how to translate strings using loco translate.
https://www.youtube.com/watch?v=D3NsDdMzsls
Please let me know if you have any further questions in the meantime.
Kind Regards
June 1, 2022 at 3:22 pm #380520
naldekhelParticipantWho said I want to translate???
Did you read what I want?I want to change the (18) to (21).
June 1, 2022 at 4:57 pm #380564
Luke NielsenKeymasterHello,
Yep, I read it. The thing is that we don’t have such settings that can change the age from the “Age verify” button so we recommend changing it via “Loco Translate”. In most cases, our customers use this plugin just to change some fields (not translate into another language).
Here is an example from my side on how to change the “Verify age” button via “Loco Translate” :
https://monosnap.com/file/VmaXfbl2b10kUlUdFju6aHg1NKI1GP
Let me know if there is anything else I can help and have a good day!
Kind Regards
June 1, 2022 at 5:22 pm #380575
naldekhelParticipantBut I can’t use loco translate, as am using WPML and it will have a conflict. Isnt there any snippet or a filter I can add to edit it?
June 1, 2022 at 5:40 pm #380583
Luke NielsenKeymasterHello,
In this case, enter the below code to the
fucntions.php
file in your child theme for changing buttons on the “Age verify” popup.if ( ! function_exists( 'woodmart_age_verify_popup' ) ) { function woodmart_age_verify_popup() { if ( ! woodmart_get_opt( 'age_verify' ) ) { return; } woodmart_enqueue_js_library( 'magnific' ); woodmart_enqueue_js_script( 'age-verify' ); woodmart_enqueue_inline_style( 'age-verify' ); woodmart_enqueue_inline_style( 'mfp-popup' ); $wrapper_classes = ' color-scheme-' . woodmart_get_opt( 'age_verify_color_scheme' ); ?> <div class="mfp-with-anim wd-popup wd-age-verify<?php echo esc_attr( $wrapper_classes ); ?>"> <div class="wd-age-verify-text"> <?php echo do_shortcode( woodmart_get_opt( 'age_verify_text' ) ); ?> </div> <div class="wd-age-verify-text-error"> <?php echo do_shortcode( woodmart_get_opt( 'age_verify_text_error' ) ); ?> </div> <div class="wd-age-verify-buttons"> <a href="#" rel="nofollow noopener" class="btn btn-color-primary wd-age-verify-allowed"> <?php esc_html_e( 'I am 21 or Older', 'woodmart' ); ?> </a> <a href="#" rel="nofollow noopener" class="btn wd-age-verify-forbidden"> <?php esc_html_e( 'I am Under 21', 'woodmart' ); ?> </a> </div> </div> <?php } add_action( 'woodmart_before_wp_footer', 'woodmart_age_verify_popup', 400 ); }
Thanks for your time and have a great day.
Kind Regards
June 1, 2022 at 6:38 pm #380590
naldekhelParticipantThanks a lot!
This worked perfectly. Is there a way to translate it? as I don’t see any related strings to it in WPML.
Thanks
June 2, 2022 at 2:57 pm #380829
Luke NielsenKeymasterHello,
Please, be sure that you have synchronized all strings from the theme via WPML -> Theme and plugins localization.
After it, find the appropriate strings via WPML -> String translation.
https://gyazo.com/ebf3262f45e8b4dbd0fd97722c7f23a2
https://gyazo.com/79519c8c06e44babe9636dc92281a301
Kind Regards
-
AuthorPosts
- You must be logged in to create new topics. Login / Register