This commit is contained in:
rahul shukla 2021-02-03 19:59:31 +05:30
parent fa045541e5
commit f6a6501a62
13 changed files with 36 additions and 11 deletions

View File

@ -14,6 +14,7 @@ class DownloadableProductDataGrid extends DataGrid
public function prepareQueryBuilder()
{
$queryBuilder = DB::table('downloadable_link_purchased')
->distinct()
->leftJoin('orders', 'downloadable_link_purchased.order_id', '=', 'orders.id')
->leftJoin('invoices', 'downloadable_link_purchased.order_id', '=', 'invoices.order_id')
->addSelect('downloadable_link_purchased.*', 'invoices.state as invoice_state', 'orders.increment_id')

View File

@ -58,6 +58,19 @@ class DownloadableProductController extends Controller
abort(403);
}
$totalInvoiceQty = 0;
if (isset($downloadableLinkPurchased->order->invoices)) {
foreach ($downloadableLinkPurchased->order->invoices as $invoice) {
$totalInvoiceQty = $totalInvoiceQty + $invoice->total_qty;
}
}
if ($downloadableLinkPurchased->download_used == $totalInvoiceQty || $downloadableLinkPurchased->download_used > $totalInvoiceQty) {
session()->flash('warning', trans('shop::app.customer.account.downloadable_products.payment-error'));
return redirect()->route('customer.downloadable_products.index');
}
if ($downloadableLinkPurchased->download_bought
&& ($downloadableLinkPurchased->download_bought - $downloadableLinkPurchased->download_used) <= 0) {

View File

@ -374,7 +374,8 @@ return [
'expired' => 'منتهية الصلاحية',
'remaining-downloads' => 'التنزيلات المتبقية',
'unlimited' => 'غير محدود',
'download-error' => 'انتهت صلاحية رابط التنزيل.'
'download-error' => 'انتهت صلاحية رابط التنزيل.',
'payment-error' => 'Payment has not been done for this download.'
],
'review' => [

View File

@ -371,7 +371,8 @@ return [
'expired' => 'Abgelaufen',
'remaining-downloads' => 'Verbleibende Downloads',
'unlimited' => 'Unbegrenzt',
'download-error' => 'Der Download-Link ist abgelaufen.'
'download-error' => 'Der Download-Link ist abgelaufen.',
'payment-error' => 'Payment has not been done for this download.'
],
'review' => [

View File

@ -375,7 +375,8 @@ return [
'expired' => 'Expired',
'remaining-downloads' => 'Remaining Downloads',
'unlimited' => 'Unlimited',
'download-error' => 'Download link has been expired.'
'download-error' => 'Download link has been expired.',
'payment-error' => 'Payment has not been done for this download.'
],
'review' => [

View File

@ -355,7 +355,8 @@ return [
'expired' => 'Caducado',
'remaining-downloads' => 'Descargas restantes',
'unlimited' => 'Ilimitado',
'download-error' => 'El enlace de descarga ha caducado.'
'download-error' => 'El enlace de descarga ha caducado.',
'payment-error' => 'Payment has not been done for this download.'
],
'review' => [

View File

@ -373,7 +373,8 @@ return [
'expired' => 'منقضی شده',
'remaining-downloads' => 'بارگیری های باقی مانده',
'unlimited' => 'نامحدود',
'download-error' => 'لینک دانلود منقضی شده است'
'download-error' => 'لینک دانلود منقضی شده است',
'payment-error' => 'Payment has not been done for this download.'
],
'review' => [

View File

@ -372,7 +372,8 @@ return [
'expired' => 'Scaduto',
'remaining-downloads' => 'Download rimasti',
'unlimited' => 'Illimitati',
'download-error' => 'Il link per il Download è scaduto.'
'download-error' => 'Il link per il Download è scaduto.',
'payment-error' => 'Payment has not been done for this download.'
],
'review' => [

View File

@ -352,7 +352,8 @@ return [
'expired' => '期限切れ',
'remaining-downloads' => '残りのダウンロード数',
'unlimited' => '無制限',
'download-error' => 'ダウンロードリンクの有効期限が切れています.'
'download-error' => 'ダウンロードリンクの有効期限が切れています.',
'payment-error' => 'Payment has not been done for this download.'
],
'review' => [

View File

@ -378,7 +378,8 @@ return [
'expired' => 'Expired',
'remaining-downloads' => 'Resterende downloads',
'unlimited' => 'Onbeperkt',
'download-error' => 'Downloadlink is verlopen.'
'download-error' => 'Downloadlink is verlopen.',
'payment-error' => 'Payment has not been done for this download.'
],
'review' => [

View File

@ -372,7 +372,8 @@ return [
'expired' => 'wygasł',
'remaining-downloads' => 'Pozostałe pliki do pobrania',
'unlimited' => 'Bez limitu',
'download-error' => 'Link do pobrania wygasł.'
'download-error' => 'Link do pobrania wygasł.',
'payment-error' => 'Payment has not been done for this download.'
],
'review' => [

View File

@ -366,7 +366,8 @@ return [
'expired' => 'Expirado',
'remaining-downloads' => 'Downloads restantes',
'unlimited' => 'Ilimitado',
'download-error' => 'O link para download expirou.'
'download-error' => 'O link para download expirou.',
'payment-error' => 'Payment has not been done for this download.'
],
'review' => [

View File

@ -371,7 +371,8 @@ return [
'expired' => 'Süresi Doldu',
'remaining-downloads' => 'Kalan İndirme',
'unlimited' => 'Sınırsız',
'download-error' => 'İndirme linki süresi doldu.'
'download-error' => 'İndirme linki süresi doldu.',
'payment-error' => 'Payment has not been done for this download.'
],
'review' => [