• Resolved sakib144

    (@sakib144)


    I’m using WordPress 5.5.5 and Electro theme. When I activate (not the ‘enable’) the plugin, no product shows up and the slider revolution is also gone (might be because the images and resources aren’t loading properly). It’s completely blank where the products are supposed to be shown. Also the cart also doesn’t show any products even though there are products in cart. When I deactivate the plugin, everything works fine. This might be my theme’s problem. But just wanted to let you know.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter sakib144

    (@sakib144)

    Well… apparently the error seems to be this:

    wallet-system-for-woocommerce-public.js?ver=2.0.1:118 Uncaught TypeError: $(...).select2 is not a function
        at HTMLDocument.<anonymous> (wallet-system-for-woocommerce-public.js?ver=2.0.1:118)
        at i (jquery.js:2)
        at Object.fireWith [as resolveWith] (jquery.js:2)
        at Function.ready (jquery.js:2)
        at HTMLDocument.J (jquery.js:2)

    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

    • This reply was modified 3 years, 9 months ago by MakeWebBetter.
    Thread Starter sakib144

    (@sakib144)

    Thank you very much. I did accordingly as you said. It fixed the problem. Thanks again. Giving you a 5 star review!

    Hi,

    Thanks for your appreciation!

    We are always here to give the best possible solution to our clients, also We are glad to hear that all of your issues are fixed and the plugin is working perfectly.

    We are waiting for your kind feedback in the review section.

    Regards,

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Crashes with theme or maybe wordpress’ is closed to new replies.