Last active
October 16, 2020 16:07
-
-
Save landbryo/c2969cdae3209867e745dc82d09b32ed to your computer and use it in GitHub Desktop.
Restrict Content Pro Avatax - Allow users to disable Avatax address validation before submitting the address.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Disable for all registrations | |
add_filter( 'rcp_avatax_disable_validate_address', '__return_true' ); | |
// Selectively disable address validation example by state/province | |
add_filter( 'rcp_avatax_disable_validate_address', function ( $disable, $post ) { | |
$state = isset( $post['rcp_card_state'] ) ? $post['rcp_card_state'] : ''; | |
if ( 'QC' === $state ) { | |
$disable = true; | |
} | |
return $disable; | |
}, 10, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment