• Resolved Gyula Csiak

    (@gycsiak)


    Dear Support,

    Please investigate with latest version of Cost of Goods Pro on any item card with variants on Admininstration site (PHP 8.2, latest WordPress, latest WooCommerce):

    Unsupported operand type: float / string

    PHP FATAL ERROR on line 482 in wp-content/plugins/cost-of-goods-woocommerce-pro/includes/class-alg-wc-cog-products.php

    Thank you in advance,

    Best regards

    Gyula Csiak – JADE Tanacsado Kft.

    The page I need help with: [log in to see the link]

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter Gyula Csiak

    (@gycsiak)

    Temporarely this modification solved the bug:

    (float)$cost_min = $this->get_product_cost( $product_id_min );
    (float)$cost_max = $this->get_product_cost( $product_id_max );
    (float)$profit_min = ( 0 != $cost_min && null != $cost_min ? $min / (float)$cost_min * 100 : ” );
    (float)$profit_max = ( 0 != $cost_max && null != $cost_max ? $max / (float)$cost_max * 100 : ” );

    Plugin Contributor Pablo Pacheco

    (@karzin)

    Hi @gycsiak ,

    I couldn’t reproduce the problem here. However I tried to make sure that kind of issue won’t happen anymore. I just tried to solve it by type casting the two variables, like this:

    $cost_min = (float) $this->get_product_cost( $product_id_min );
    $cost_max = (float) $this->get_product_cost( $product_id_max );

    Please, update the plugin to version 2.9.4 I just released and let me know if it helps.

    Thread Starter Gyula Csiak

    (@gycsiak)

    Hi @karzin ,

    Thank you, problem solved succesfully.

    Best regards,

    Gyula Csiak

    Plugin Contributor Pablo Pacheco

    (@karzin)

    Great, thanks for letting me know. I’m closing the ticket then

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Unsupported operand type error on product card in admin’ is closed to new replies.