Modify ↓
#2359 closed Bug/Fehler (duplicate)
Divison by zero Warning in xtcPrice Class
| Reported by: | noRiddle | Owned by: | somebody |
|---|---|---|---|
| Priority: | normal | Milestone: | modified-shop-2.0.8.0 |
| Component: | Shop | Version: | 2.0.7.2 |
| Keywords: | Cc: | ||
| Blocked By: | Blocking: |
Description
Hatte in einem Shop plötzlich dieses Warning:
Division by zero in File: /PATH/includes/classes/xtcPrice.php on Line: 760
Kommen dürfte das von Zeile 181 ff:
if ((float)$pPrice == 0) {
$pPrice = $this->getPprice($pID);
}
und kommt vor wenn ein Preis in der Tabelle products auf 0.0000 steht, was vorkommen kann wenn man Artikel über eine Lieferanten-API automatisiert updatet.
Vorschlag dazu wäre den Code zu ändern in
if (!((float)$pPrice > 0)) {
$pPrice = $this->getPprice($pID);
}
Gruß,
noRiddle
Attachments (0)
Change History (2)
comment:1 by , 3 years ago
comment:2 by , 3 years ago
| Resolution: | → duplicate |
|---|---|
| Status: | new → closed |
Duplikat zu #2318
Version 0, edited 3 years ago by (next)
Note:
See TracTickets
for help on using tickets.

Sehe gerade, daß mein Vorschlag ja auch nichts bringt, weil die Funktion getPprice() den Preis ja auch aus der Tabelle products holt.
Das muß man wohl in der Funktion xtcFormatSpecialDiscount() direkt abfangen, indem man false return-t wenn $pPrice nicht > 0 ist.
Gruß,
noRiddle