Merge pull request #5675 from akhtarkhan1/product-download
Fixed Download product issue #5663
This commit is contained in:
commit
0fe5b20bda
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -65,6 +65,9 @@ class DownloadableProductController extends Controller
|
|||
}
|
||||
}
|
||||
|
||||
$orderedQty = $downloadableLinkPurchased->order->total_qty_ordered;
|
||||
$totalInvoiceQty = $totalInvoiceQty * ($downloadableLinkPurchased->download_bought / $orderedQty);
|
||||
|
||||
if ($downloadableLinkPurchased->download_used == $totalInvoiceQty || $downloadableLinkPurchased->download_used > $totalInvoiceQty) {
|
||||
session()->flash('warning', trans('shop::app.customer.account.downloadable_products.payment-error'));
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue