Forum Replies Created

Viewing 9 replies - 1 through 9 (of 9 total)
  • Thread Starter avaiskhatri

    (@avaiskhatri)

    @yukikatayama , @htdat, @johndcoy

    I have figured that this was happening because only Papyal express checkout was enable. So when I turned of checkout option from product and cart page, Place order button was appearing at checkout page.

    Now the issue is that my default currency is QAR, for that I have added QAR in paypal currecny list using this code.

    add_filter('woocommerce_currency_symbol', 'add_qar_currency_symbol', 10, 2);  
     
    function add_qar_currency_symbol( $currency_symbol, $currency ) {  
      switch( $currency ) {  
      case 'QAR': $currency_symbol = 'QAR'; break;  
      }  
     return $currency_symbol;  
    }
    
    add_filter( 'woocommerce_paypal_supported_currencies', 'add_qar_paypal_valid_currency' );       
    
    function add_qar_paypal_valid_currency( $currencies ) {    
       array_push ( $currencies , 'QAR' );  
       return $currencies;    
    }

    And coverting usd to qar using this function

    add_filter('woocommerce_paypal_args', 'convert_qar_to_usd', 11 );  
    function get_currency($from, $to){
      $from = "USD";
      $to = "QAR"; 
    		
      // create curl resource 
      $ch = curl_init(); 
     
      // set url 
      curl_setopt($ch, CURLOPT_URL, "https://free.currencyconverterapi.com/api/v5/convert?q={$from}_{$to}&compact=ultra"); 
     
      //return the transfer as a string 
      curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); 
     
      // $output contains the output string 
      $output = curl_exec($ch);
      // close curl resource to free up system resources 
      curl_close($ch); 
      $data = explode(':', $output);
      $data = explode(" ", $data[1]);
      $amnt = round($data[0], 2);
      return $amnt;
    }
    
    function convert_qar_to_usd($paypal_args){
        if ( $paypal_args['currency_code'] == 'QAR'){  
    	$convert_rate = get_currency(); //Set converting rate
    	$paypal_args['currency_code'] = 'USD'; //change AED to USD  
        $i = 1;  
            while (isset($paypal_args['amount_' . $i])) {  
                $paypal_args['amount_' . $i] = round( $paypal_args['amount_' . $i] / $convert_rate, 2);
                ++$i;  
            }  
    		if ( $paypal_args['shipping_1'] > 0 ) {
    			$paypal_args['shipping_1'] = round( $paypal_args['shipping_1'] / $convert_rate, 2);
    		}
    		if ( $paypal_args['discount_amount_cart'] > 0 ) {
    			$paypal_args['discount_amount_cart'] = round( $paypal_args['discount_amount_cart'] / $convert_rate, 2);
    		}
    		if ( $paypal_args['tax_cart'] > 0 ) {
      			$paypal_args['tax_cart'] = round( $paypal_args['tax_cart'] / $convert_rate, 2);
    		}
    			
    	}
    return $paypal_args;  
    } 

    But its still showing currency problem. Please look into the problem.

    Thread Starter avaiskhatri

    (@avaiskhatri)

    Hi, the error was removed when I changed the currency to USD, but now no button is appearing on either cart page, checkout page.

    Thread Starter avaiskhatri

    (@avaiskhatri)

    @johndcoy I am still waiting for the help.

    Thread Starter avaiskhatri

    (@avaiskhatri)

    @johndcoy
    Hi, I have already switched to default theme and only WooCommerce and PayPal Checkout plugin are active but the problem is still there.

    On product page & cart page “PayPal” Button appears but on checkout page “PayPal” button doesn’t even appear.

    On clicking PayPal button on product and cart page, this error appears “PayPal error (10605): An error (10605) occurred while processing your PayPal payment. Please contact the store owner for assistance.”

    On checkout page, apparently no error appears but on checking console too many errors appears.

    For testing I have set the scenario on this website:
    https://armapparels.com

    and the pages are :
    https://armapparels.com/cart/
    https://armapparels.com/checkout/

    Thread Starter avaiskhatri

    (@avaiskhatri)

    Its firing too many errors, which are as follows:

    Uncaught Error: Document is ready and element #woo_pp_ec_button_cart does not exist
    at dom.js:123
    logger.js:63 ppxo_unhandled_error Object
    print @ logger.js:63
    exceptions.js:22 Uncaught Error: Document is ready and element #woo_pp_ec_button_cart does not exist
    at dom.js:123
    component.jsx:774 Uncaught Error: Document is ready and element #woo_pp_ec_button_cart does not exist
    at dom.js:109
    at new ZalgoPromise (promise.js:41)
    at elementReady (dom.js:99)
    at ParentComponent.elementReady (index.js:632)
    at index.js:136
    at Function.ZalgoPromise.try (promise.js:400)
    at index.js:134
    at Function.ZalgoPromise.try (promise.js:400)
    at ParentComponent.tryInit (index.js:1282)
    at ParentComponent.render (index.js:124)
    logger.js:63 ppxo_unhandled_error Object
    print @ logger.js:63
    exceptions.js:22 Uncaught Error: Document is ready and element #woo_pp_ec_button_cart does not exist
    at dom.js:109
    at new ZalgoPromise (promise.js:41)
    at elementReady (dom.js:99)
    at ParentComponent.elementReady (index.js:632)
    at index.js:136
    at Function.ZalgoPromise.try (promise.js:400)
    at index.js:134
    at Function.ZalgoPromise.try (promise.js:400)
    at ParentComponent.tryInit (index.js:1282)
    at ParentComponent.render (index.js:124)

    Thread Starter avaiskhatri

    (@avaiskhatri)

    @mariakravchenko
    Hi,
    After seeing the error log file following error was causing 500 error:

    PHP Fatal error: Call to undefined function Dompdf\mb_internal_encoding() in /home/xxxx/public_html/wp-content/plugins/wp-invoice-pdf/lib/third-party/dompdf/src/Dompdf.php

    After a quick google I have fixed the problem after enabling php_mbstring extension.

    Thanks for the help.

    Thread Starter avaiskhatri

    (@avaiskhatri)

    @mariakravchenko how much memory that WP Invoice requires to generate a PDF file?w

    Thread Starter avaiskhatri

    (@avaiskhatri)

    @mariakravchenko

    Disabling all other plugins and changing theme didn’t worked aswell.

    Thread Starter avaiskhatri

    (@avaiskhatri)

    Hi,

    Previously it was working fine, now it is showing HTTP 500 Error.

    Tried removing logo and it’s not working aswell.

Viewing 9 replies - 1 through 9 (of 9 total)