From 41c56cb170ac9f031ce559b882f2cba4f538291b Mon Sep 17 00:00:00 2001 From: Semenov Date: Mon, 22 Jul 2024 23:59:02 +0300 Subject: [PATCH] dev --- src/models/ShopOrder.php | 2 +- src/models/ShopOrderItem.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/models/ShopOrder.php b/src/models/ShopOrder.php index 24252ee..ac177e8 100644 --- a/src/models/ShopOrder.php +++ b/src/models/ShopOrder.php @@ -1771,7 +1771,7 @@ public function getDiscount_percent() { $percent = 0; - if ($this->discount_amount) { + if ($this->discount_amount && $this->moneyItems->amount) { $percent = $this->discount_amount * 100 / (float)$this->moneyItems->amount; } diff --git a/src/models/ShopOrderItem.php b/src/models/ShopOrderItem.php index 413af67..ab4d961 100644 --- a/src/models/ShopOrderItem.php +++ b/src/models/ShopOrderItem.php @@ -562,7 +562,7 @@ public function getDiscount_percent() { $percent = 0; - if ($this->discount_amount) { + if ($this->discount_amount && $this->amount) { $percent = $this->discount_amount * 100 / $this->amount; }