Hi,
Thanks for getting in touch with us!
We have checked the issue from our end and make some changes in the plugin files to make the issue fixed. Please check these changes and proceed accordingly.
1. In public/src/js/wallet-system-for-woocommerce-public.js
a. replace line 102 "if ( response.message !== 'Please enter amount less than or equal to wallet balance' ) {"
with "if ( response.status == true ) {"
b. remove code from line 118 to 222
$('.mwb-wallet-userselect2').select2({
ajax: {
url: wsfw_public_param.ajaxurl,
dataType: 'json',
delay: 200,
data: function(params){
return{
email: params.term,
action: 'mwb_search_for_user'
};
},
processResults: function(data){
var users = [];
if(data)
{
$.each(data, function(index,text){
text[2] += '(' + text[1] + ')';
users.push({id:text[0], text:text[2]});
});
}
return{
results: users
};
},
cache:true
},
minimumInputLength: 4
});
$(document).on( 'click','#wallet_payment_method', function() {
var method = $(this).val();
console.log(method);
if ( method == 'Bank Transfer' ) {
$('.show-on-bank-transfer').show();
$('.show-on-paypal').hide();
$('.error').hide();
} else if ( method == 'PayPal' ) {
$('.show-on-paypal').show();
$('.show-on-bank-transfer').hide();
$('.error').hide();
} else {
$('.show-on-bank-transfer').hide();
$('.show-on-paypal').hide();
$('.error').hide();
$('#mwb_withdrawal_request').prop('disabled', true);
}
});
$('#mwb_wallet_paypal_email').blur(function() {
var email = $(this).val();
if ( email == '' ) {
$('.error').show();
$('.error').html('Please enter an email id');
$('#mwb_withdrawal_request').prop('disabled', true);
} else {
$('.error').hide();
$('#mwb_withdrawal_request').prop('disabled', false);
}
});
$('#mwb_wallet_bank_account_name').blur(function() {
var accountname = $(this).val();
if ( accountname == '' ) {
$('.error').show();
$('.error').html('Please enter your account name');
$('#mwb_withdrawal_request').prop('disabled', true);
} else {
$('.error').hide();
$('#mwb_withdrawal_request').prop('disabled', false);
}
});
$('#mwb_wallet_bank_account_no').blur(function() {
var accountno = $(this).val();
if ( accountno == '' ) {
$('.error').show();
$('.error').html('Please enter your account number');
$('#mwb_withdrawal_request').prop('disabled', true);
} else {
$('.error').hide();
$('#mwb_withdrawal_request').prop('disabled', false);
}
});
$('#mwb_wallet_bank_sort_code').blur(function() {
var sortcode = $(this).val();
if ( sortcode == '' ) {
$('.error').show();
$('.error').html('Please enter sort code');
$('#mwb_withdrawal_request').prop('disabled', true);
} else {
$('.error').hide();
$('#mwb_withdrawal_request').prop('disabled', false);
}
});
2. In file public/class-wallet-system-for-woocommerce-public.php
a. replace line 91 "wp_enqueue_script( 'mwb-public-min', WALLET_SYSTEM_FOR_WOOCOMMERCE_DIR_URL . 'public/js/mwb-public.min.js', array(), $this->version, 'all' );"
with
global $wp_query;
$is_endpoint = isset( $wp_query->query_vars[ 'mwb-wallet' ] ) ? $wp_query->query_vars[ 'mwb-wallet' ] : '';
if ( ( 'wallet-transactions' === $is_endpoint || 'wallet-withdrawal' === $is_endpoint ) && is_account_page() ) {
wp_enqueue_script( 'mwb-public-min', WALLET_SYSTEM_FOR_WOOCOMMERCE_DIR_URL . 'public/js/mwb-public.min.js', array(), $this->version, 'all' );
}
3. In file includes/class-wallet-system-for-woocommerce.php
a. remove line 284 and 285
$this->loader->add_action( 'wp_enqueue_scripts', $wsfw_plugin_public, 'wsfw_public_enqueue_styles' );
$this->loader->add_action( 'wp_enqueue_scripts', $wsfw_plugin_public, 'wsfw_public_enqueue_scripts' );
b. add code after line 288 "if ( isset( $enable ) && 'on' === $enable ) {"
$this->loader->add_action( 'wp_enqueue_scripts', $wsfw_plugin_public, 'wsfw_public_enqueue_styles' );
$this->loader->add_action( 'wp_enqueue_scripts', $wsfw_plugin_public, 'wsfw_public_enqueue_scripts' );
4. In file includes/class-wallet-system-ajaxhandler.php
a. add code after line 55 "$wallet_amount -= $amount;"
$message['status'] = true;
b. add code after line 60 "} else {"
$message['status'] = false;
Hope this will resolve your concern. Also we will update this in the next update to fix the error.
Thanks and regards
Makewebbetter