• Resolved drmirr

    (@drmirr)


    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 790

    The 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.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support Mirza Hamza

    (@hamza1010)

    Hello @drmirr,

    Thanks for contacting us,

    I hope you are doing well, We’ve informed our technical team about your issue, and they will work on it promptly. When we receive their response, we will get back to you. Our team is here to assist you.

    Thanks & Regards
    WP Experts Support Team

    Plugin Support Mirza Hamza

    (@hamza1010)

    Hello @drmirr,

    This issue is not coming on our staging, the provided code is correct and will solve the given error but we will still incorporate the code you wrote into our plugin and include it in the new release.

    If you have any questions, feel free to reach out. We’re here to assist you.

    Thank you

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.