From 244a9ddb045a327c0b6e7c3e6664d87475bd2ce1 Mon Sep 17 00:00:00 2001
From: Swastik
Date: Tue, 21 May 2024 17:49:47 +0530
Subject: [PATCH] solve captcha issue at localhost
---
assets/frontend/js/frontend.js | 6 +++++-
classes/class-woocommerce-catalog-enquiry-frontend.php | 6 +++++-
2 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/assets/frontend/js/frontend.js b/assets/frontend/js/frontend.js
index ea8a948..1ae0083 100644
--- a/assets/frontend/js/frontend.js
+++ b/assets/frontend/js/frontend.js
@@ -99,6 +99,10 @@ jQuery( document ).ready( function ( $ ) {
}
);
+ var hideCap = document.getElementById('hideCap').value;
+ console.log(hideCap);
+
+
$( '#woocommerce-submit-enquiry' ).on( 'click', function () {
var name = document.getElementById( 'woocommerce-user-name' ).value;
var email = document.getElementById( 'woocommerce-user-email' ).value;
@@ -191,7 +195,7 @@ jQuery( document ).ready( function ( $ ) {
.focus();
return false;
}
- if ( captcha && captcha.value != catalog_enquiry_front.captcha ) {
+ if ( captcha && captcha.value != hideCap ) {
document.getElementById( 'msg-for-enquiry-error' ).innerHTML =
catalog_enquiry_front.error_levels.captcha_valid;
document
diff --git a/classes/class-woocommerce-catalog-enquiry-frontend.php b/classes/class-woocommerce-catalog-enquiry-frontend.php
index 7c7630f..04baa4a 100644
--- a/classes/class-woocommerce-catalog-enquiry-frontend.php
+++ b/classes/class-woocommerce-catalog-enquiry-frontend.php
@@ -595,7 +595,11 @@ public function add_form_for_enquiry_without_popup() {
} else {
echo __('Security Code', 'woocommerce-catalog-enquiry');
}
- ?>
+ ?>
+
+
+
+