0

guys,

I recently installed an extension to display the installment price.

However, the following error appears in the log:

Warning: A non-numeric value encountered in /app/code/community/Contardi/Installments/Helper/Data.php on line 87

The code in the Data.php file is as follows:

public function getDescontoPrimeiraParcela($valorParcela)
{
    $percentual = $this->descontoPrimeiraParcela;
    $desconto = (float)(str_ireplace(',', '.', $percentual) / 100); // line 87
    if ($desconto) $valorParcela -= ($valorParcela * $desconto);
    return $valorParcela;
}

Does anyone know what can it be?

Thanks.

1 Answer 1

0

Which value do you get back for $percentual = $this->descontoPrimeiraParcela? It seems like it's not returning a numeric value. Maybe there's a percent sign in it or something that cannot be casted to a proper float value.

In general you could disable PHP Warnings through editing the index.php, more information about it here: https://www.php.net/manual/de/function.error-reporting.php

2
  • Friend, I discovered the problem: the field descontoPrimeiraParcela is blank in the settings. That's why it doesn't return any numeric value. Thank you for your help.
    – Rodrigo
    Commented Jul 27, 2021 at 16:00
  • Great. You're welcome
    – Marco
    Commented Jul 28, 2021 at 12:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.