• Barry

    (@barryhughes-1)


    Hi gang,

    Using a fresh install of iTheme Exchange, if I try to create a new product the following warning is generated:

    Warning: A non-numeric value encountered in wp-content/plugins/ithemes-exchange/api/misc.php on line 127

    It looks like, if _it_exchange_sale_price is not set for a particular product (such as a new product), then we pass an empty string to it_exchange_convert_from_database_number() which then tries to divide the empty string by 100, resulting in the error.

    A cast to int might help:

    function it_exchange_convert_from_database_number( $price ) {
    	return number_format( (int) $price / 100, 2, '.', '' );
    }

    The warning is just a warning, and the end result with a cast in place is the same, but this would reduce noise in the error logs etc.

    Be awesome if this/some other appropriate fix could be put in place!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Elise Alley

    (@ecalley)

    Hi Barry,

    Thanks for the feedback; I’ve passed this along to the appropriate people.

    In case you are not aware, we will be turning the iThemes Exchange project over to a very competent leader and long-time WordPress community member, AJ Morris, and his team at ExchangeWP.com in early August 2017. You can read more about it here: https://ithemes.com/2017/07/13/ithemes-exchange-new-home-exchangewpcom/

    Let us know if you have any additional questions.

    Thanks,

    Elise

    Thread Starter Barry

    (@barryhughes-1)

    This still seems to be an issue. Any update? Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Trying to do arithmetic with non-numeric value’ is closed to new replies.