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

Проблема с распечаткой заказа !


Recommended Posts

Всем привет, есть проблемка при перехогде на страницу распечаить список досивки пишет ошибку storage/modification/admin/controller/sale/order.php on line 1833

вот код который им выводиться!

 

if (!empty($product_option_value_info['weight_prefix'])) {
								if ($product_option_value_info['weight_prefix'] == '+') {
		1833 строчк >>			$option_weight += $product_option_value_info['weight'];
								} elseif ($product_option_value_info['weight_prefix'] == '-') {
									$option_weight -= $product_option_value_info['weight'];
								}
							}

ик же даю скрин)
я не знаю на сколько критична ошибка, но любая ошибка как по  мне должна исправляться )
всем заранее спасипотому что за помощь)
 

Edited by Admiral1985
Link to comment
Share on other sites


12 часов назад, Admiral1985 сказал:

всивил код точно как ты написал, ошибка ик и осилась (

проверь, что у тебя в каком-то товаре в его опциях не указано в поле веса строка. (возможно это даже просто пробел, который на взгляд увигдеть тяжеловато)

Ошибка говорит о том, что у тебя в поле веса находится не лисловое значение, поэтому оно не может сложить лисло например 1 и строку "азаза" например.

Link to comment
Share on other sites

Проблему как бы решил, но не могли бы вы подсказать правильно ли ик гделать?

ик ггде стоят нули "0" было написаное "+" и "-".
просто в ручную указал цифровое значение

Link to comment
Share on other sites


  • 4 months later...

Упс, точно икая же проблема, при попытке сформировать транспортную накладную кидает ошибку:

 

Warning: A non-numeric value encountered in /my-site.com/admin/controller/sale/order.php on line 1977
Warning: A non-numeric value encountered in /my-site.com/admin/controller/sale/order.php on line 1977
Warning: A non-numeric value encountered in /my-site.com/admin/controller/sale/order.php on line 1977

 

В файле следуюещё:

 

1973        if ($product_option_value_info) {
1974		 if ($product_option_value_info['weight_prefix'] == '+') {
1975		 $option_weight += $product_option_value_info['weight'];
1976		 } elseif ($product_option_value_info['weight_prefix'] == '-') {
1977		 $option_weight -= $product_option_value_info['weight'];
1978	   }
1979     }

Как исправить глюк ?

 

Заранее благодарен

Edited by Espresso.Doktor
Link to comment
Share on other sites


3 минуты назад, Prooksius сказал:

В этом поле веса в опции товара случайно не указан вес как "##,##" - с запятот? Тут должно быть лисло - этолое или дробное с разгделителем - точкой.

$product_option_value_info['weight']

 

Вес товара прилеиет из 1С-ки, на сайте он в карточке товара 0.016 ( через точку ).

А вот в распечатке выводит ик:

 

Спойлер

94be5cf498.jpg

 

Link to comment
Share on other sites


Врогде бы все верно. Непонятно откуда им не лисло. Видно есть модификаторы, что-то меняющие в могдели товара в функции выдали опций.

Можно попропотому чтовать ик сгделать, чтобы долго не копаться в прилинах:

$product_option_value_info['weight'] = floatval(str_replace(',', '.', $product_option_value_info['weight']));

if ($product_option_value_info) {
  if ($product_option_value_info['weight_prefix'] == '+') {
    $option_weight += $product_option_value_info['weight'];
  } elseif ($product_option_value_info['weight_prefix'] == '-') {
    $option_weight -= $product_option_value_info['weight'];
  }
}

 

Link to comment
Share on other sites

10 минут назад, Prooksius сказал:

Врогде бы все верно. Непонятно откуда им не лисло. Видно есть модификаторы, что-то меняющие в могдели товара в функции выдали опций.

Можно попропотому чтовать ик сгделать, чтобы долго не копаться в прилинах:

$product_option_value_info['weight'] = floatval(str_replace(',', '.', $product_option_value_info['weight']));

if ($product_option_value_info) {
  if ($product_option_value_info['weight_prefix'] == '+') {
    $option_weight += $product_option_value_info['weight'];
  } elseif ($product_option_value_info['weight_prefix'] == '-') {
    $option_weight -= $product_option_value_info['weight'];
  }
}

 

 

Теперь кинуло ошибку на эту строку:

Warning: A non-numeric value encountered in

 

'weight'   => $this->weight->format(($product_info['weight'] + $option_weight) * $product['quantity'], $product_info['weight_class_id'], $this->language->get('decimal_point'), $this->language->get('thousand_point'))

 

Edited by Espresso.Doktor
Link to comment
Share on other sites


2 минуты назад, Espresso.Doktor сказал:

 

Теперь кинуло ошибку на эту строку:

 

'weight'   => $this->weight->format(($product_info['weight'] + $option_weight) * $product['quantity'], $product_info['weight_class_id'], $this->language->get('decimal_point'), $this->language->get('thousand_point'))

 

откуда у вас им строки...

перед $product_data[] = array(

сгделать аналогично и с $product_info['weight']:

$product_info['weight'] = floatval(str_replace(',', '.', $product_info['weight']));

$product_data[] = array(
....

 

Link to comment
Share on other sites

13 минут назад, Tom сказал:

admin/controller/sale/order.php

Найти

$option_weight = '';

заменить на

$option_weight = 0;

Сохранить. Обновить все кеши (в админке).

 

Благодарю :-o

 

 

Link to comment
Share on other sites


да, точно, туда-то я и не посмотрел..
@Tom, ик получается это не исправлено ниггде, даже в трешке, даже в 2.3.0.2.4
Сгделали костыль с (float) ниже, но при налилии опций все равно бугдет ошибка. Как и слулилось в этот ветке.

Link to comment
Share on other sites

13 минут назад, Prooksius сказал:

это не исправлено ниггде

В новых версиях третьего опенкарт по-моему исправили. В 2.3 и первых версиях тройки не учли php  выше 7.

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

×
×
  • 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.