Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

[РЕШЕНО] Корзина покупок: Warning: Division by zero in *****/system/library/weight.php on line 38


RedCastle
 Share

Recommended Posts

Всем привет! Я новичок в этом движке. Очень надеюсь на Вашу помощь или советы.

Перейду сразу к проблеме.

Я выбрал несколько товаров, затем нажимаю "Просмотр карзины" - появляется ошибка Warning: Division by zero in *****/system/library/weight.php on line 38 и куча безобразного кода. Смотрите скриншот.

П.с. Можете пройти сами на сайт и попробовать - jade.by

Заранее спасибо откликнувшемся!

post-21798-0-79334800-1348682959_thumb.jpg

  • +1 1
Link to comment
Share on other sites


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

  • +1 1
Link to comment
Share on other sites


  • 1 month later...
  • 3 months later...
  • 2 months later...
  • 3 months later...
  • 4 weeks later...

Спасибо большое все работает!

 

Работает то работает, только все расчеты стоимости доставки от веса и тд будут не работать.

Я бы лучше решение попробовал, как Tom посоветовал:

public function convert($value, $from, $to) {
if ($from == $to) {
return $value;
}

if (isset($this->weights[$from])) {
$from = $this->weights[$from]['value'];
} else {
$from = 0;
}

if (isset($this->weights[$to])) {
$to = $this->weights[$to]['value'];
} else {
$to = 0;
}	

if($from == 0)
return $value;
return @($value * ($to / $from));
} 

Так, о чем это я :) собственно у мены была похожая ошибка:

PHP Warning: Division by zero in public_html/system/library/length.php on line 38

Причем при заполненных размерах..

В итоге оказалось, что не заполнил поле: length unit (см. или метры).

 

Всем удачной работы :)

  • +1 2
Link to comment
Share on other sites


  • 3 months later...
  • 1 month later...

Работает то работает, только все расчеты стоимости доставки от веса и тд будут не работать.

Я бы лучше решение попробовал, как Tom посоветовал:

public function convert($value, $from, $to) {
if ($from == $to) {
return $value;
}

if (isset($this->weights[$from])) {
$from = $this->weights[$from]['value'];
} else {
$from = 0;
}

if (isset($this->weights[$to])) {
$to = $this->weights[$to]['value'];
} else {
$to = 0;
}	

if($from == 0)
return $value;
return @($value * ($to / $from));
} 

Так, о чем это я :) собственно у мены была похожая ошибка:

PHP Warning: Division by zero in public_html/system/library/length.php on line 38

Причем при заполненных размерах..

В итоге оказалось, что не заполнил поле: length unit (см. или метры).

 

Всем удачной работы :)

спасибо. Очень помогли

Link to comment
Share on other sites


  • 2 months later...
  • 4 months later...

Спасибо за решение.

 

Работает то работает, только все расчеты стоимости доставки от веса и тд будут не работать.

Я бы лучше решение попробовал, как Tom посоветовал:

public function convert($value, $from, $to) {
if ($from == $to) {
return $value;
}

if (isset($this->weights[$from])) {
$from = $this->weights[$from]['value'];
} else {
$from = 0;
}

if (isset($this->weights[$to])) {
$to = $this->weights[$to]['value'];
} else {
$to = 0;
}	

if($from == 0)
return $value;
return @($value * ($to / $from));
} 

Так, о чем это я :) собственно у мены была похожая ошибка:

PHP Warning: Division by zero in public_html/system/library/length.php on line 38

Причем при заполненных размерах..

В итоге оказалось, что не заполнил поле: length unit (см. или метры).

 

Всем удачной работы :)

Спасибо, помогло. Урааааа

Link to comment
Share on other sites


  • 2 months later...
public function convert($value, $from, $to) {

if ($from == $to) {

      return $value;

}

 

if (isset($this->weights[$from])) {

$from = $this->weights[$from]['value'];

} else {

$from = 0;

}

 

if (isset($this->weights[$to])) {

$to = $this->weights[$to]['value'];

} else {

$to = 0;

}

 

return $value;

Link to comment
Share on other sites


  • 6 years later...

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.