Skip to content

Commit

Permalink
dev
Browse files Browse the repository at this point in the history
  • Loading branch information
skeeks-semenov committed Jul 22, 2024
1 parent 1c70ec7 commit 41c56cb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/models/ShopOrder.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
2 changes: 1 addition & 1 deletion src/models/ShopOrderItem.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 41c56cb

Please sign in to comment.