Home Forums WoodMart support forum Age Verfication – Change Age

Age Verfication – Change Age

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #380384

    naldekhel
    Participant

    Hi 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.
    #380514

    Luke Nielsen
    Keymaster

    Hello,

    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

    #380520

    naldekhel
    Participant

    Who said I want to translate???
    Did you read what I want?

    I want to change the (18) to (21).

    #380564

    Luke Nielsen
    Keymaster

    Hello,

    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

    #380575

    naldekhel
    Participant

    But 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?

    #380583

    Luke Nielsen
    Keymaster

    Hello,

    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

    #380590

    naldekhel
    Participant

    Thanks 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

    #380829

    Luke Nielsen
    Keymaster

    Hello,

    Please, be sure that you have synchronized all strings from the theme via WPML -> Theme and plugins localization.

    https://prnt.sc/m_KbF97SZwY1

    After it, find the appropriate strings via WPML -> String translation.

    https://gyazo.com/ebf3262f45e8b4dbd0fd97722c7f23a2

    https://gyazo.com/79519c8c06e44babe9636dc92281a301

    Kind Regards

Viewing 8 posts - 1 through 8 (of 8 total)