I manage to make the phone field as required. And share it over here if that is not too late.
/plugins/woocommerce-catalog-enquiry/classes/class-wc-Woocommerce-Catalog-Enquiry-frontend.php
add the code under // error levels
$error_levels['phone_required'] = __('Phone is required field', 'woocommerce-catalog-enquiry');
/plugins/woocommerce-catalog-enquiry/assets/frontend/js/frontend.js
add the code under var email = document.getElementById(‘woo_user_email’).value;
var phone = document.getElementById('woo_user_phone').value;
find the email validation condition.
if (email == ” || email == ‘ ‘) {
document.getElementById(‘msg_for_enquiry_error’).innerHTML = catalog_enquiry_front.error_levels.email_required;
document.getElementById(‘woo_user_email’).focus();
return false;
}
add the following code under it.
if (phone == '' || email == ' ') {
document.getElementById('msg_for_enquiry_error').innerHTML =
catalog_enquiry_front.error_levels.phone_required;
document.getElementById('woo_user_phone').focus();
return false;
}
-
This reply was modified 6 years, 1 month ago by madbug.