Skip to content

Instantly share code, notes, and snippets.

@cartimize
Created October 8, 2021 10:31
Show Gist options
  • Save cartimize/30f3ebdf352b69b4b3aa3ef8d8ae85e0 to your computer and use it in GitHub Desktop.
Save cartimize/30f3ebdf352b69b4b3aa3ef8d8ae85e0 to your computer and use it in GitHub Desktop.
Add custom error for front end validation
<?php
add_filter('cartimize_front_end_parsley_errors', 'cartimize_custom_cartimize_front_end_parsley_errors', 10, 1);
function cartimize_custom_cartimize_front_end_parsley_errors( $value ){
$value['parsley_errors']['shipping_address_1']= "Please enter your street address along with your house number";
$value['parsley_errors']['billing_address_1']= "Please enter your street address along with your house number";
return $value;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment