resolve issue of downloadable product when it gets cancelled #5663
This commit is contained in:
parent
abcc1f1aad
commit
33b422b29c
|
|
@ -106,6 +106,9 @@ class DownloadableLinkPurchasedRepository extends Repository
|
|||
$totalInvoiceQty = $totalInvoiceQty + $invoice_item->qty;
|
||||
}
|
||||
|
||||
$orderedQty = $purchasedLink->order_item->qty_ordered;
|
||||
$totalInvoiceQty = $totalInvoiceQty * ($purchasedLink->download_bought / $orderedQty);
|
||||
|
||||
$this->update([
|
||||
'status' => $purchasedLink->download_used == $totalInvoiceQty ? $status : $purchasedLink->status,
|
||||
'download_canceled' => $purchasedLink->download_bought - $totalInvoiceQty,
|
||||
|
|
|
|||
Loading…
Reference in New Issue