Viewing 3 replies - 1 through 3 (of 3 total)
  • Hi,

    Just to let you know that i have read your msg – please give me time till tomorrow to revert on this.

    Regards,
    Neha

    Thread Starter Ravikumar Patel

    (@ravipatel)

    Hi,Neha
    Make change on hear path:

    woocommerce-catalog-enquiry\classes\class-wc-Woocommerce-Catalog-Enquiry-frontend.php

    Add code for Email & phone validation.

    Add this code after “if (email == ” || email == ‘ ‘)” this condition at line no 410.

    if (!isValidEmailAddress(email)) {
    	document.getElementById('msg_for_enquiry_error').innerHTML = '<?php echo __('Email is not valid', $WC_Woocommerce_Catalog_Enquiry->text_domain); ?>';
    	document.getElementById('woo_user_email').focus();
    	return false;
    }
    if(phone !=""){
    	if(!validatePhone(phone)){
    		document.getElementById('msg_for_enquiry_error').innerHTML = '<?php echo __('Phone is not valid', $WC_Woocommerce_Catalog_Enquiry->text_domain); ?>';
    		document.getElementById('woo_user_phone').focus();
    		return false;
    	}
    }

    Add this fuction before function do_toggle() at near line no 500

    function isValidEmailAddress(emailAddress) {
    	var pattern = /^([a-z\d!#$%&'*+\-\/=?^_<code>{|}~\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+(\.[a-z\d!#$%&'*+\-\/=?^_</code>{|}~\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+)*|"((([ \t]*\r\n)?[ \t]+)?([\x01-\x08\x0b\x0c\x0e-\x1f\x7f\x21\x23-\x5b\x5d-\x7e\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]|\\[\x01-\x09\x0b\x0c\x0d-\x7f\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))*(([ \t]*\r\n)?[ \t]+)?")@(([a-z\d\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]|[a-z\d\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF][a-z\d\-._~\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]*[a-z\d\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])\.)+([a-z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]|[a-z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF][a-z\d\-._~\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]*[a-z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])\.?$/i;
    	return pattern.test(emailAddress);
    };
    
    function validatePhone(Phone) {
    	var filter = /^[0-9]{10}$/;
    	if (filter.test(Phone)) {
    		return true;
    	}
    	else {
    		return false;
    	}
    }

    Others suggestion use different class then “responsive” for popup when non technical person use your plugin in site “responsive” class to called responsive menu on first click in popup.

    Regards,
    Ravi patel

    Dualcube

    (@dualcube)

    Hi Ravi,

    Thanks for your support ?? Happy to inform you that we have come up with our latest version 2.3.0 and considered the email validation issue.

    I’m marking this as complete. Please feel free to open a thread if you need any more help.

    Request- A 5/5 rating would definitely help us to reach out more users ??

    Thanks,
    Neha

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Suggestion : Email validation not working & image not found’ is closed to new replies.