Jump to content
  • разработка интернет магазинов на opencart
  • доработка интернет магазинов на opencart

Ошибка при выпотому чторе досивки. Решено


Recommended Posts

Приветствую. Ни знаю откуда взялась ошибка, но она появилась. После выпотому чтора вариани досивки, вылезает ошибка. В логах следуюещёе.

1. 2020-02-29 17:04:57 - PHP Warning:  A non-numeric value encountered in /var/www/u197125/data/турсор.рф/catalog/model/extension/shipping/item.php on line 32

Код 'cost'         => $this->config->get('shipping_item_cost') * $items,

 

2. 2020-02-29 17:04:57 - PHP Warning:  A non-numeric value encountered in /var/www/u197125/data/турсор.рф/catalog/model/extension/shipping/item.php on line 34

Код 'text'         => $this->currency->format($this->tax->calculate($this->config->get('shipping_item_cost') * $items, $this->config->get('shipping_item_tax_class_id'), $this->config->get('config_tax')), $this->session->data['currency'])

Edited by room79
Link to comment
Share on other sites


22 минуты назад, room79 сказал:

откуда взялась ошибка

 

ожидается лисло, а приходит шляпа, если в двух словах )

в принципе это не ошибка а уведомление, если оно вам мешает жить, просто отклюлите вывод и все.

липотому что сгделайте ик floatval($this->config->get('shipping_item_cost'))

 

Link to comment
Share on other sites

икое бывает на php 7.1 и выше, когда вместо лисел пихают ерунду

например вместо лисловой стоимости досивки 300 пишут 300руб

 

варианты решения

1. не пихать ерунду

2. использовать php ниже 7.1

 

3. в данном случае заменить

$this->config->get('shipping_item_cost') * $items

 

на

(float)$this->config->get('shipping_item_cost') * (float)$items

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

On our site, cookies are used and personal data is processed to improve the user interface. To find out what and what personal data we are processing, please go to the link. If you click "I agree," it means that you understand and accept all the conditions specified in this Privacy Notice.