Modify

Opened 8 years ago

Closed 8 years ago

Last modified 7 years ago

#1477 closed Bug/Fehler (fixed)

Division by Zero in admin/specials.php

Reported by: info@… Owned by: somebody
Priority: niedrig Milestone: modified-shop-2.0.5.0
Component: Admin Version: 2.0.4.0
Keywords: Cc:
Blocked By: Blocking:

Description

Guten Morgen,

es wird zwar selten vorkommen, bei einem meiner Kunden trat es aber auf:
Ist ein Artikelpreis mit 0 Euro angegeben und zu diesem Artikel existiert ein (aktives oder nicht aktives) Sonderangebot, gibt es eine Warning in Zeile 341 der admin/specials.php

$contents[] = array('text' => '' . TEXT_INFO_PERCENTAGE . ' ' . number_format(100 - (($sInfo->specials_new_products_price / $sInfo->products_price) * 100)) . '%');

Mein Vorschlag ist, die Zeile einfach zu ersetzen durch:

if(empty($sInfo->products_price))
  $contents[] = array('text' => '' . TEXT_INFO_PERCENTAGE . ' 0%');
else
  $contents[] = array('text' => '' . TEXT_INFO_PERCENTAGE . ' ' . number_format(100 - (($sInfo->specials_new_products_price / $sInfo->products_price) * 100)) . '%');

Attachments (0)

Change History (2)

comment:1 by Gerhard Waldemair, 8 years ago

Resolution: fixed
Status: newclosed

In 11281:

fix #1477

comment:2 by Torsten Riemer, 7 years ago

Milestone: modified-shop-2.0.4.1modified-shop-2.0.5.0

Modify Ticket

Action
as closed The owner will remain somebody.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.