Plugin Directory

Changeset 2466184


Ignore:
Timestamp:
02/01/2021 07:08:01 AM (5 years ago)
Author:
infinitools
Message:

Some fixes

Location:
decentralized-bitcoin-cryptodec-payment-gateway-for-woocommerce/trunk
Files:
1 deleted
1 edited

Legend:

Unmodified
Added
Removed
  • decentralized-bitcoin-cryptodec-payment-gateway-for-woocommerce/trunk/inc/itls-crypto-dec-payment-gateway-class.php

    r2465865 r2466184  
    7272                <div class="payment-method-cryptodec">
    7373<?php
    74 
    75 // TODO:: if prices is already in BTC no exchange needed !!!
    76 
    7774                $cart_total = WC()->cart->total; // $woocommerce->cart->total;
     75                $btc_coin = 'BTC';
    7876                $curr_code = get_woocommerce_currency();
    7977
    80                 $btc_coin = 'BTC';
    81                 $btc_amount = $itls_btc->getBtcAmount($cart_total, $curr_code); //$curr_code.' '.$cart_total;
     78                if ($curr_code!=$btc_coin) {
     79                    $btc_amount = $itls_btc->getBtcAmount($cart_total, $curr_code);
     80                } else {
     81                    $btc_amount = $cart_total;
     82                }
    8283
    83                 // add wallet and amount to the order custom fields !!!
    8484                if ($btc_amount < 0.00000001) {
    8585                    wc_add_notice(esc_html__('BTC Exchange Rate can nott be obtained', 'decentralized-bitcoin-cryptodec-payment-gateway-for-woocommerce'), 'error');
Note: See TracChangeset for help on using the changeset viewer.