Home › Forums › WoodMart support forum › Age Verfication – Change Age › Reply To: Age Verfication – Change Age
June 1, 2022 at 5:40 pm
#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