WordPress.org

Forums

WooCommerce - excelling eCommerce
Paypall Error (2 posts)

  1. Sciencefiction68
    Member
    Posted 1 year ago #

    Hi im having one problem since i updated to latest version of woocommerce. Before update paypall payment worked as charm. But after im receiving

    "You have entered unsupported characters for this field. Current available language character types are: European, Chinese, Korean, Japanese, and Thai. Please try again."

    Error. I guess I should note that i have added custom currency to function s.php

    // Add currency / symbol/////////////////////////////////////////////////////////////////////////////////////////Yeni sisteme ekle :)
    add_filter( 'woocommerce_currencies', 'add_AZN_currency' );
    add_filter( 'woocommerce_currency_symbol', 'add_AZN_currency_symbol' );
    
    function add_AZN_currency( $currencies ) {
        $currencies['AZN'] = __( 'Azerbaijani New Manat (AZN)', 'woothemes' );
        return $currencies;
    }
    
    function add_AZN_currency_symbol( $symbol ) {
    	$currency = get_option( 'woocommerce_currency' );
    	switch( $currency ) {
    		case 'AZN': $symbol = 'AZN'; break;
    	}
    	return $symbol;
    }
    ////////////////////////////////////////////////////////////////////////////////////////////////////////////

    and paypal support to class-wc-gateway-paypal.php

    //////////////////////Yeni verisyalara ekle bunu!:)
    add_filter( 'woocommerce_paypal_supported_currencies', 'add_AZN_paypal_valid_currency' );
        function add_AZN_paypal_valid_currency( $currencies ) {
         array_push ( $currencies , 'AZN' );
         return $currencies;
        }   
    
     add_filter('woocommerce_paypal_args', 'convert_AZN_to_usd');
    function convert_AZN_to_usd($paypal_args){
        if ( $paypal_args['currency_code'] == 'AZN'){
            $convert_rate = 1.954; //set the converting rate
            $paypal_args['currency_code'] = 'usd'; //change BGN to EUR
            $i = 1;  
    
            while (isset($paypal_args['amount_' . $i])) {
                $paypal_args['amount_' . $i] = round( $paypal_args['amount_' . $i] * $convert_rate, 2);
                ++$i;
            }  
    
        }
    return $paypal_args;
    }

    After update all other currency symbols change to AZN (my custom) when i choose azn as store currency.

    Also im using WordPress on Turkish language. Im receiving same error even when i use usd as store currency. Everything worked with no problem with same configs before.
    What is wrong with the system?

    http://wordpress.org/plugins/woocommerce/

  2. Sciencefiction68
    Member
    Posted 1 year ago #

    Just a quick addition. Switched back to English language but still same result. :S

    [Moderator Note: No bumping, thank you.]

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • WooCommerce - excelling eCommerce
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic