mycred-woocommerce-gateway.php on line 790 / Exchange Rate
-
Hello,
I set it to pay only with mycred points and use the Woocommerce-mycred payment gateway.
An error occurred in the file below, so I had no choice but to directly edit the plugin file to resolve it.
Fatal error: Uncaught Error: Unsupported operand types: string / string
in /home/example.com/public_html/wp-content/plugins/mycred/addons/woocommerce/includes/mycred-woocommerce-gateway.php on line 790The mycred version is 2.7.3.
// Apply Exchange Rate
// line 790 $cost ? ?= $mycred->number( ( $woocommerce->cart->total / $available_gateways['mycred']->get_option( 'exchange_rate' ) ) );>> changed
$cart_total = floatval($woocommerce->cart->total);
$exchange_rate = floatval($available_gateways['mycred']->get_option('exchange_rate'));
$exchange_rate = ($exchange_rate <= 0) ? 1 : $exchange_rate;
$cost = $mycred->number($cart_total / $exchange_rate);I wish you could tell me a better solution.
I hope this problem is solved.
- You must be logged in to reply to this topic.