Skip to content

Instantly share code, notes, and snippets.

@cartimize
Last active October 9, 2021 04:37
Show Gist options
  • Save cartimize/d670b5d10cb53a58fd39973d38160af4 to your computer and use it in GitHub Desktop.
Save cartimize/d670b5d10cb53a58fd39973d38160af4 to your computer and use it in GitHub Desktop.
How to activate the custom JS validator for the following fields (billing_address_1, shipping_address_1)
<?php
add_filter('cartimize_get_billing_checkout_fields', 'cartimize_custom_get_billing_checkout_fields', 10, 1);
function cartimize_custom_get_billing_checkout_fields( $value ){
$value['billing_address_1']['parsley_custom_validator']= true;
return $value;
}
add_filter('cartimize_get_shipping_checkout_fields', 'cartimize_custom_get_shipping_checkout_fields', 10, 1);
function cartimize_custom_get_shipping_checkout_fields( $value ){
$value['shipping_address_1']['parsley_custom_validator']= true;
return $value;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment