diff --git a/packages/Webkul/Admin/src/DataGrids/OrderInvoicesDataGrid.php b/packages/Webkul/Admin/src/DataGrids/OrderInvoicesDataGrid.php index 11b545ef7..0570987c3 100755 --- a/packages/Webkul/Admin/src/DataGrids/OrderInvoicesDataGrid.php +++ b/packages/Webkul/Admin/src/DataGrids/OrderInvoicesDataGrid.php @@ -45,6 +45,19 @@ class OrderInvoicesDataGrid extends DataGrid 'filterable' => true, ]); + $this->addColumn([ + 'index' => 'created_at', + 'label' => trans('admin::app.datagrid.invoice-date'), + 'type' => 'string', + 'searchable' => true, + 'sortable' => true, + 'filterable' => true, + 'closure' => true, + 'wrapper' => function ($value) { + return \Carbon\Carbon::parse($value->created_at)->format('d-m-Y'); + } + ]); + $this->addColumn([ 'index' => 'base_grand_total', 'label' => trans('admin::app.datagrid.grand-total'), @@ -55,12 +68,22 @@ class OrderInvoicesDataGrid extends DataGrid ]); $this->addColumn([ - 'index' => 'created_at', - 'label' => trans('admin::app.datagrid.invoice-date'), - 'type' => 'datetime', + 'index' => 'state', + 'label' => trans('admin::app.datagrid.state'), + 'type' => 'string', + 'closure' => true, 'searchable' => true, 'sortable' => true, 'filterable' => true, + 'wrapper' => function ($value) { + if ($value->state == 'paid') { + return ''. trans('admin::app.sales.orders.invoice-status-paid') .''; + } elseif ($value->state == "pending") { + return ''. trans('admin::app.sales.orders.invoice-status-pending') .''; + } elseif ($value->state == "overdue") { + return ''. trans('admin::app.sales.orders.invoice-status-overdue') . ''; + } + } ]); } diff --git a/packages/Webkul/Admin/src/Http/Controllers/Customer/CustomerController.php b/packages/Webkul/Admin/src/Http/Controllers/Customer/CustomerController.php index 18ec38400..4c4de66c7 100755 --- a/packages/Webkul/Admin/src/Http/Controllers/Customer/CustomerController.php +++ b/packages/Webkul/Admin/src/Http/Controllers/Customer/CustomerController.php @@ -64,12 +64,12 @@ class CustomerController extends Controller CustomerGroupRepository $customerGroupRepository, ChannelRepository $channelRepository ) - + { $this->_config = request('_config'); $this->middleware('admin'); $this->customerRepository = $customerRepository; - + $this->customerAddressRepository = $customerAddressRepository; $this->customerGroupRepository = $customerGroupRepository; $this->channelRepository = $channelRepository; @@ -200,12 +200,19 @@ class CustomerController extends Controller $customer = $this->customerRepository->findorFail($id); try { - $this->customerRepository->delete($id); + + if (! $this->customerRepository->checkIfCustomerHasOrderPendingOrProcessing($customer)) { + + $this->customerRepository->delete($id); + } else { + + return response()->json(['message' => false], 400); + } session()->flash('success', trans('admin::app.response.delete-success', ['name' => 'Customer'])); - return response()->json(['message' => true], 200); } catch (\Exception $e) { + session()->flash('error', trans('admin::app.response.delete-failed', ['name' => 'Customer'])); } @@ -279,12 +286,18 @@ class CustomerController extends Controller { $customerIds = explode(',', request()->input('indexes')); - foreach ($customerIds as $customerId) { - $this->customerRepository->deleteWhere(['id' => $customerId]); + if (!$this->customerRepository->checkBulkCustomerIfTheyHaveOrderPendingOrProcessing($customerIds)) { + + foreach ($customerIds as $customerId) { + $this->customerRepository->deleteWhere(['id' => $customerId]); + } + + session()->flash('success', trans('admin::app.customers.customers.mass-destroy-success')); + + return redirect()->back(); } - session()->flash('success', trans('admin::app.customers.customers.mass-destroy-success')); - + session()->flash('error', trans('admin::app.response.order-pending', ['name' => 'Customers'])); return redirect()->back(); } } \ No newline at end of file diff --git a/packages/Webkul/Admin/src/Http/Controllers/Sales/InvoiceController.php b/packages/Webkul/Admin/src/Http/Controllers/Sales/InvoiceController.php index 3931fc268..2d346bf2a 100755 --- a/packages/Webkul/Admin/src/Http/Controllers/Sales/InvoiceController.php +++ b/packages/Webkul/Admin/src/Http/Controllers/Sales/InvoiceController.php @@ -2,9 +2,12 @@ namespace Webkul\Admin\Http\Controllers\Sales; +use Illuminate\Http\Request; + use Webkul\Admin\Http\Controllers\Controller; use Webkul\Sales\Repositories\OrderRepository; use Webkul\Sales\Repositories\InvoiceRepository; + use PDF; class InvoiceController extends Controller @@ -97,7 +100,7 @@ class InvoiceController extends Controller $data = request()->all(); $haveProductToInvoice = false; - + foreach ($data['invoice']['items'] as $itemId => $qty) { if ($qty) { $haveProductToInvoice = true; @@ -145,4 +148,29 @@ class InvoiceController extends Controller return $pdf->download('invoice-' . $invoice->created_at->format('d-m-Y') . '.pdf'); } + + /** + * Update the invoice state. + * + * @param int $id + * @return \Illuminate\Http\Response + */ + public function updateState($id, Request $request) + { + $invoice = $this->invoiceRepository->findOrFail($id); + $task = $this->invoiceRepository->updateInvoiceState($invoice, $request->state); + + if($request->state == 'paid'){ + $order = $this->orderRepository->findOrFail($invoice->order->id); + $this->orderRepository->updateOrderStatus($order); + } + + if ($task){ + session()->flash('success', trans('admin::app.sales.orders.invoice-status-confirmed')); + } else { + session()->flash('success', trans('admin::app.sales.orders.invoice-status-error')); + } + + return back(); + } } diff --git a/packages/Webkul/Admin/src/Http/Requests/ConfigurationForm.php b/packages/Webkul/Admin/src/Http/Requests/ConfigurationForm.php index 4611ad6b5..3eb339d75 100644 --- a/packages/Webkul/Admin/src/Http/Requests/ConfigurationForm.php +++ b/packages/Webkul/Admin/src/Http/Requests/ConfigurationForm.php @@ -29,9 +29,17 @@ class ConfigurationForm extends FormRequest if (request()->has('general.design.admin_logo.logo_image') && ! request()->input('general.design.admin_logo.logo_image.delete') ) { - $this->rules = [ - 'general.design.admin_logo.logo_image' => 'required|mimes:jpeg,bmp,png,jpg', - ]; + $this->rules = array_merge($this->rules, [ + 'general.design.admin_logo.logo_image' => 'required|mimes:jpeg,bmp,png,jpg|max:5000', + ]); + } + + if (request()->has('general.design.admin_logo.favicon') + && ! request()->input('general.design.admin_logo.favicon.delete') + ) { + $this->rules = array_merge($this->rules, [ + 'general.design.admin_logo.favicon' => 'required|mimes:jpeg,bmp,png,jpg|max:5000', + ]); } return $this->rules; @@ -48,4 +56,15 @@ class ConfigurationForm extends FormRequest 'general.design.admin_logo.logo_image.mimes' => 'Invalid file format. Use only jpeg, bmp, png, jpg.', ]; } -} + + /** + * Set the attribute name. + */ + public function attributes() + { + return [ + 'general.design.admin_logo.logo_image' => 'Logo Image', + 'general.design.admin_logo.favicon' => 'Favicon Image' + ]; + } +} \ No newline at end of file diff --git a/packages/Webkul/Admin/src/Http/routes.php b/packages/Webkul/Admin/src/Http/routes.php index b4f9cce62..07ab2fc32 100755 --- a/packages/Webkul/Admin/src/Http/routes.php +++ b/packages/Webkul/Admin/src/Http/routes.php @@ -211,6 +211,10 @@ Route::group(['middleware' => ['web']], function () { 'view' => 'admin::sales.invoices.print', ])->name('admin.sales.invoices.print'); + Route::post('/invoices/update/state/{order_id}', 'Webkul\Admin\Http\Controllers\Sales\InvoiceController@updateState')->defaults('_config', [ + 'redirect' => 'admin.sales.orders.view', + ])->name('admin.sales.invoices.update.state'); + // Sales Shipments Routes Route::get('/shipments', 'Webkul\Admin\Http\Controllers\Sales\ShipmentController@index')->defaults('_config', [ diff --git a/packages/Webkul/Admin/src/Listeners/Order.php b/packages/Webkul/Admin/src/Listeners/Order.php index f2e1c06c5..7bebf23b9 100755 --- a/packages/Webkul/Admin/src/Listeners/Order.php +++ b/packages/Webkul/Admin/src/Listeners/Order.php @@ -3,14 +3,15 @@ namespace Webkul\Admin\Listeners; use Illuminate\Support\Facades\Mail; -use Webkul\Admin\Mail\NewOrderNotification; use Webkul\Admin\Mail\NewAdminNotification; -use Webkul\Admin\Mail\NewInvoiceNotification; -use Webkul\Admin\Mail\NewShipmentNotification; -use Webkul\Admin\Mail\NewInventorySourceNotification; -use Webkul\Admin\Mail\CancelOrderNotification; +use Webkul\Admin\Mail\NewOrderNotification; use Webkul\Admin\Mail\NewRefundNotification; +use Webkul\Admin\Mail\NewInvoiceNotification; +use Webkul\Admin\Mail\CancelOrderNotification; +use Webkul\Admin\Mail\NewShipmentNotification; use Webkul\Admin\Mail\OrderCommentNotification; +use Webkul\Admin\Mail\CancelOrderAdminNotification; +use Webkul\Admin\Mail\NewInventorySourceNotification; class Order { @@ -117,10 +118,18 @@ class Order public function sendCancelOrderMail($order) { try { + /* email to customer */ $configKey = 'emails.general.notifications.emails.general.notifications.cancel-order'; if (core()->getConfigData($configKey)) { Mail::queue(new CancelOrderNotification($order)); } + + /* email to admin */ + $configKey = 'emails.general.notifications.emails.general.notifications.new-admin'; + if (core()->getConfigData($configKey)) { + app()->setLocale(env('APP_LOCALE')); + Mail::queue(new CancelOrderAdminNotification($order)); + } } catch (\Exception $e) { report($e); } diff --git a/packages/Webkul/Admin/src/Listeners/PasswordChange.php b/packages/Webkul/Admin/src/Listeners/PasswordChange.php new file mode 100644 index 000000000..88fedf523 --- /dev/null +++ b/packages/Webkul/Admin/src/Listeners/PasswordChange.php @@ -0,0 +1,31 @@ +order = $order; + } + + public function build() + { + return $this->from(core()->getSenderEmailDetails()['email'], core()->getSenderEmailDetails()['name']) + ->to(core()->getAdminEmailDetails()['email']) + ->subject(trans('shop::app.mail.order.cancel.subject')) + ->view('shop::emails.sales.order-cancel-admin'); + } +} \ No newline at end of file diff --git a/packages/Webkul/Admin/src/Mail/OrderCommentNotification.php b/packages/Webkul/Admin/src/Mail/OrderCommentNotification.php index c76361e7c..09ffdaa16 100644 --- a/packages/Webkul/Admin/src/Mail/OrderCommentNotification.php +++ b/packages/Webkul/Admin/src/Mail/OrderCommentNotification.php @@ -38,7 +38,7 @@ class OrderCommentNotification extends Mailable { return $this->from(core()->getSenderEmailDetails()['email'], core()->getSenderEmailDetails()['name']) ->to($this->comment->order->customer_email, $this->comment->order->customer_full_name) - ->subject(trans('shop::app.mail.order.comment.subject')) + ->subject(trans('shop::app.mail.order.comment.subject', ['order_id' => $this->comment->order->increment_id])) ->view('shop::emails.sales.new-order-comment'); } } diff --git a/packages/Webkul/Admin/src/Providers/EventServiceProvider.php b/packages/Webkul/Admin/src/Providers/EventServiceProvider.php index cb38d77c1..f40932b14 100755 --- a/packages/Webkul/Admin/src/Providers/EventServiceProvider.php +++ b/packages/Webkul/Admin/src/Providers/EventServiceProvider.php @@ -14,6 +14,8 @@ class EventServiceProvider extends ServiceProvider */ public function boot() { + Event::listen('user.admin.update-password', 'Webkul\Admin\Listeners\PasswordChange@sendUpdatePasswordMail'); + Event::listen('checkout.order.save.after', 'Webkul\Admin\Listeners\Order@sendNewOrderMail'); Event::listen('sales.invoice.save.after', 'Webkul\Admin\Listeners\Order@sendNewInvoiceMail'); diff --git a/packages/Webkul/Admin/src/Resources/lang/de/app.php b/packages/Webkul/Admin/src/Resources/lang/de/app.php index 881147964..192909b92 100755 --- a/packages/Webkul/Admin/src/Resources/lang/de/app.php +++ b/packages/Webkul/Admin/src/Resources/lang/de/app.php @@ -320,6 +320,14 @@ return array ( 'invoice-btn-title' => 'Rechnung', 'info' => 'Informationen', 'invoices' => 'Rechnungen', + 'invoices-change-title' => 'Change invoice state', + 'invoices-change-state-desc' => 'Please select the new invoice state:', + 'invoice-status-paid' => 'Paid', + 'invoice-status-pending' => 'Pending', + 'invoice-status-overdue' => 'Overdue', + 'invoice-status-update' => 'Save changes', + 'invoice-status-confirmed' => 'The invoice state has been changed.', + 'invoice-status-error' => 'Could not update the invoice state. ', 'shipments' => 'Sendungen', 'order-and-account' => 'Bestellung und Rechnung', 'order-info' => 'Bestellinformationen', diff --git a/packages/Webkul/Admin/src/Resources/lang/en/app.php b/packages/Webkul/Admin/src/Resources/lang/en/app.php index ac7a8ad25..fd1c381bf 100755 --- a/packages/Webkul/Admin/src/Resources/lang/en/app.php +++ b/packages/Webkul/Admin/src/Resources/lang/en/app.php @@ -319,6 +319,14 @@ return [ 'invoice-btn-title' => 'Invoice', 'info' => 'Information', 'invoices' => 'Invoices', + 'invoices-change-title' => 'Change invoice state', + 'invoices-change-state-desc' => 'Please select the new invoice state:', + 'invoice-status-paid' => 'Paid', + 'invoice-status-pending' => 'Pending', + 'invoice-status-overdue' => 'Overdue', + 'invoice-status-update' => 'Save changes', + 'invoice-status-confirmed' => 'The invoice state has been changed.', + 'invoice-status-error' => 'Could not update the invoice state. ', 'shipments' => 'Shipments', 'order-and-account' => 'Order and Account', 'order-info' => 'Order Information', @@ -1219,7 +1227,7 @@ return [ 'cancel-success' => ':name canceled successfully.', 'cancel-error' => ':name can not be canceled.', 'already-taken' => 'The :name has already been taken.', - 'order-pending' => 'Cannot delete account because some Order(s) are pending or processing state.' + 'order-pending' => 'Cannot delete :name account because some Order(s) are pending or processing state.' ], 'footer' => [ diff --git a/packages/Webkul/Admin/src/Resources/lang/fa/app.php b/packages/Webkul/Admin/src/Resources/lang/fa/app.php index 6f88bc54e..410af2d47 100644 --- a/packages/Webkul/Admin/src/Resources/lang/fa/app.php +++ b/packages/Webkul/Admin/src/Resources/lang/fa/app.php @@ -318,6 +318,14 @@ return [ 'invoice-btn-title' => 'صورت حساب', 'info' => 'اطلاعات', 'invoices' => 'صورت حساب ها', + 'invoices-change-title' => 'Change invoice state', + 'invoices-change-state-desc' => 'Please select the new invoice state:', + 'invoice-status-paid' => 'Paid', + 'invoice-status-pending' => 'Pending', + 'invoice-status-overdue' => 'Overdue', + 'invoice-status-update' => 'Save changes', + 'invoice-status-confirmed' => 'The invoice state has been changed.', + 'invoice-status-error' => 'Could not update the invoice state. ', 'shipments' => 'حمل و نقل ها', 'order-and-account' => 'سفارش و حساب', 'order-info' => 'اطلاعات سفارش', diff --git a/packages/Webkul/Admin/src/Resources/lang/it/app.php b/packages/Webkul/Admin/src/Resources/lang/it/app.php index 580ab92d2..fca9749c8 100644 --- a/packages/Webkul/Admin/src/Resources/lang/it/app.php +++ b/packages/Webkul/Admin/src/Resources/lang/it/app.php @@ -318,6 +318,14 @@ return [ 'invoice-btn-title' => 'Fattura', 'info' => 'Informazoni', 'invoices' => 'Fatture', + 'invoices-change-title' => 'Change invoice state', + 'invoices-change-state-desc' => 'Please select the new invoice state:', + 'invoice-status-paid' => 'Paid', + 'invoice-status-pending' => 'Pending', + 'invoice-status-overdue' => 'Overdue', + 'invoice-status-update' => 'Save changes', + 'invoice-status-confirmed' => 'The invoice state has been changed.', + 'invoice-status-error' => 'Could not update the invoice state. ', 'shipments' => 'Spedizioni', 'order-and-account' => 'Ordine e Account', 'order-info' => 'informazioni Ordine', diff --git a/packages/Webkul/Admin/src/Resources/lang/nl/app.php b/packages/Webkul/Admin/src/Resources/lang/nl/app.php index 3c67966f2..f7ca87ef7 100644 --- a/packages/Webkul/Admin/src/Resources/lang/nl/app.php +++ b/packages/Webkul/Admin/src/Resources/lang/nl/app.php @@ -318,6 +318,14 @@ return [ 'invoice-btn-title' => 'Factuur', 'info' => 'Informatie', 'invoices' => 'Facturen', + 'invoices-change-title' => 'Change invoice state', + 'invoices-change-state-desc' => 'Please select the new invoice state:', + 'invoice-status-paid' => 'Paid', + 'invoice-status-pending' => 'Pending', + 'invoice-status-overdue' => 'Overdue', + 'invoice-status-update' => 'Save changes', + 'invoice-status-confirmed' => 'The invoice state has been changed.', + 'invoice-status-error' => 'Could not update the invoice state. ', 'shipments' => 'Verzendingen', 'order-and-account' => 'Order and Account', 'order-info' => 'Order Information', diff --git a/packages/Webkul/Admin/src/Resources/lang/pl/app.php b/packages/Webkul/Admin/src/Resources/lang/pl/app.php index a714a24b3..960202a88 100644 --- a/packages/Webkul/Admin/src/Resources/lang/pl/app.php +++ b/packages/Webkul/Admin/src/Resources/lang/pl/app.php @@ -317,6 +317,14 @@ return [ 'invoice-btn-title' => 'Faktura', 'info' => 'Informacje', 'invoices' => 'Faktury', + 'invoices-change-title' => 'Change invoice state', + 'invoices-change-state-desc' => 'Please select the new invoice state:', + 'invoice-status-paid' => 'Paid', + 'invoice-status-pending' => 'Pending', + 'invoice-status-overdue' => 'Overdue', + 'invoice-status-update' => 'Save changes', + 'invoice-status-confirmed' => 'The invoice state has been changed.', + 'invoice-status-error' => 'Could not update the invoice state. ', 'shipments' => 'Przesyłki', 'order-and-account' => 'Zamówienie i konto', 'order-info' => 'Informacje o zamówieniu', diff --git a/packages/Webkul/Admin/src/Resources/lang/pt_BR/app.php b/packages/Webkul/Admin/src/Resources/lang/pt_BR/app.php index fb31ad0dc..4043e01f3 100755 --- a/packages/Webkul/Admin/src/Resources/lang/pt_BR/app.php +++ b/packages/Webkul/Admin/src/Resources/lang/pt_BR/app.php @@ -318,6 +318,14 @@ return [ 'invoice-btn-title' => 'Faturar', 'info' => 'Informação', 'invoices' => 'Faturas', + 'invoices-change-title' => 'Change invoice state', + 'invoices-change-state-desc' => 'Please select the new invoice state:', + 'invoice-status-paid' => 'Paid', + 'invoice-status-pending' => 'Pending', + 'invoice-status-overdue' => 'Overdue', + 'invoice-status-update' => 'Save changes', + 'invoice-status-confirmed' => 'The invoice state has been changed.', + 'invoice-status-error' => 'Could not update the invoice state. ', 'shipments' => 'Envios', 'order-and-account' => 'Pedido e Conta', 'order-info' => 'Informação do Pedido', diff --git a/packages/Webkul/Admin/src/Resources/lang/tr/app.php b/packages/Webkul/Admin/src/Resources/lang/tr/app.php index b9bd5afd2..f1c7b8103 100644 --- a/packages/Webkul/Admin/src/Resources/lang/tr/app.php +++ b/packages/Webkul/Admin/src/Resources/lang/tr/app.php @@ -316,6 +316,14 @@ return [ 'invoice-btn-title' => 'Fatura', 'info' => 'Bilgi', 'invoices' => 'Faturalar', + 'invoices-change-title' => 'Change invoice state', + 'invoices-change-state-desc' => 'Please select the new invoice state:', + 'invoice-status-paid' => 'Paid', + 'invoice-status-pending' => 'Pending', + 'invoice-status-overdue' => 'Overdue', + 'invoice-status-update' => 'Save changes', + 'invoice-status-confirmed' => 'The invoice state has been changed.', + 'invoice-status-error' => 'Could not update the invoice state. ', 'shipments' => 'Kargo', 'order-and-account' => 'Sipariş ve Hesap', 'order-info' => 'Sipariş Bilgisi', diff --git a/packages/Webkul/Admin/src/Resources/views/sales/invoices/index.blade.php b/packages/Webkul/Admin/src/Resources/views/sales/invoices/index.blade.php index 42b871faf..ef1dd4412 100755 --- a/packages/Webkul/Admin/src/Resources/views/sales/invoices/index.blade.php +++ b/packages/Webkul/Admin/src/Resources/views/sales/invoices/index.blade.php @@ -13,10 +13,7 @@
- - - {{ __('admin::app.export.export') }} - + {{ __('admin::app.export.export') }}
diff --git a/packages/Webkul/Admin/src/Resources/views/sales/invoices/view.blade.php b/packages/Webkul/Admin/src/Resources/views/sales/invoices/view.blade.php index 0666ce986..06fb088b8 100755 --- a/packages/Webkul/Admin/src/Resources/views/sales/invoices/view.blade.php +++ b/packages/Webkul/Admin/src/Resources/views/sales/invoices/view.blade.php @@ -1,10 +1,10 @@ -@extends('admin::layouts.master') +@extends('admin::layouts.content') @section('page_title') {{ __('admin::app.sales.invoices.view-title', ['invoice_id' => $invoice->id]) }} @stop -@section('content-wrapper') +@section('content') order; ?> @@ -15,11 +15,18 @@ {!! view_render_event('sales.invoice.title.before', ['order' => $order]) !!} - {{ __('admin::app.sales.invoices.view-title', ['invoice_id' => $invoice->id]) }} {!! view_render_event('sales.invoice.title.after', ['order' => $order]) !!} + + @if($invoice->state == 'paid') + {{ __('admin::app.sales.orders.invoice-status-paid') }} + @elseif($invoice->state == 'pending') + {{ __('admin::app.sales.orders.invoice-status-pending') }} + @else + {{ __('admin::app.sales.orders.invoice-status-overdue') }} + @endif
@@ -29,6 +36,10 @@ {{ __('admin::app.sales.invoices.print') }} + @if($invoice->state == "pending" || $invoice->state == "overdue") + {{ __('admin::app.sales.orders.invoices-change-title') }} + @endif + {!! view_render_event('sales.invoice.page_action.after', ['order' => $order]) !!}
@@ -37,7 +48,7 @@
-
+
@@ -46,10 +57,7 @@
- - {{ __('admin::app.sales.invoices.order-id') }} - - + {{ __('admin::app.sales.invoices.order-id') }} #{{ $order->increment_id }} @@ -58,69 +66,55 @@ {!! view_render_event('sales.invoice.increment_id.after', ['order' => $order]) !!}
- - {{ __('admin::app.sales.orders.order-date') }} - - - - {{ $order->created_at }} - + {{ __('admin::app.sales.orders.order-date') }} + {{ $order->created_at }}
{!! view_render_event('sales.invoice.created_at.after', ['order' => $order]) !!}
- - {{ __('admin::app.sales.orders.order-status') }} - - - - {{ $order->status_label }} - + {{ __('admin::app.sales.orders.order-status') }} + {{ $order->status_label }}
{!! view_render_event('sales.invoice.status_label.after', ['order' => $order]) !!}
- - {{ __('admin::app.sales.orders.channel') }} - - - - {{ $order->channel_name }} - + {{ __('admin::app.sales.orders.channel') }} + {{ $order->channel_name }}
{!! view_render_event('sales.invoice.channel_name.after', ['order' => $order]) !!} + +
+ {{ __('admin::app.sales.orders.payment-method') }} + {{ core()->getConfigData('sales.paymentmethods.' . $order->payment->method . '.title') }} +
+ +
+ {{ __('admin::app.sales.orders.shipping-method') }} + {{ $order->shipping_title }} +
+ {!! view_render_event('sales.invoice.shipping-method.after', ['order' => $order]) !!}
-
+
{{ __('admin::app.sales.orders.account-info') }}
- - {{ __('admin::app.sales.orders.customer-name') }} - - - - {{ $invoice->address->name }} - + {{ __('admin::app.sales.orders.customer-name') }} + {{ $invoice->address->name }}
{!! view_render_event('sales.invoice.customer_name.after', ['order' => $order]) !!}
- - {{ __('admin::app.sales.orders.email') }} - - - - {{ $invoice->address->email }} - + {{ __('admin::app.sales.orders.email') }} + {{ $invoice->address->email }}
{!! view_render_event('sales.invoice.customer_email.after', ['order' => $order]) !!} @@ -131,14 +125,14 @@ -
+
-
+
{{ __('admin::app.sales.orders.billing-address') }}
-
+
@include ('admin::sales.address', ['address' => $order->billing_address]) {!! view_render_event('sales.invoice.billing_address.after', ['order' => $order]) !!} @@ -146,86 +140,18 @@
@if ($order->shipping_address) -
-
+
+
{{ __('admin::app.sales.orders.shipping-address') }}
-
+
@include ('admin::sales.address', ['address' => $order->shipping_address]) {!! view_render_event('sales.invoice.shipping_address.after', ['order' => $order]) !!}
@endif - -
- - - -
- -
-
- {{ __('admin::app.sales.orders.payment-info') }} -
- -
-
- - {{ __('admin::app.sales.orders.payment-method') }} - - - - {{ core()->getConfigData('sales.paymentmethods.' . $order->payment->method . '.title') }} - -
- -
- - {{ __('admin::app.sales.orders.currency') }} - - - - {{ $order->order_currency_code }} - -
- - {!! view_render_event('sales.invoice.payment-method.after', ['order' => $order]) !!} -
-
- - @if ($order->shipping_address) -
-
- {{ __('admin::app.sales.orders.shipping-info') }} -
- -
-
- - {{ __('admin::app.sales.orders.shipping-method') }} - - - - {{ $order->shipping_title }} - -
- -
- - {{ __('admin::app.sales.orders.shipping-price') }} - - - - {{ core()->formatBasePrice($order->base_shipping_amount) }} - -
- - {!! view_render_event('sales.invoice.shipping-method.after', ['order' => $order]) !!} -
-
- @endif
@@ -254,9 +180,7 @@ @foreach ($invoice->items as $item) {{ $item->getTypeInstance()->getOrderedItem($item)->sku }} - - - {{ $item->name }} + {{ $item->name }} @if (isset($item->additional['attributes']))
@@ -264,19 +188,14 @@ @foreach ($item->additional['attributes'] as $attribute) {{ $attribute['attribute_name'] }} : {{ $attribute['option_label'] }}
@endforeach -
@endif {{ core()->formatBasePrice($item->base_price) }} - {{ $item->qty }} - {{ core()->formatBasePrice($item->base_total) }} - {{ core()->formatBasePrice($item->base_tax_amount) }} - @if ($invoice->base_discount_amount > 0) {{ core()->formatBasePrice($item->base_discount_amount) }} @endif @@ -284,7 +203,6 @@ {{ core()->formatBasePrice($item->base_total + $item->base_tax_amount - $item->base_discount_amount) }} @endforeach -
@@ -322,12 +240,61 @@ {{ core()->formatBasePrice($invoice->base_grand_total) }} -
-
-
-@stop \ No newline at end of file +
+ + +

{{ __('admin::app.sales.orders.invoices-change-title') }}

+
+ +
+
+@stop + +@push('scripts') + + + +@endpush diff --git a/packages/Webkul/Admin/src/Resources/views/sales/orders/view.blade.php b/packages/Webkul/Admin/src/Resources/views/sales/orders/view.blade.php index e7923525d..92b8cafeb 100755 --- a/packages/Webkul/Admin/src/Resources/views/sales/orders/view.blade.php +++ b/packages/Webkul/Admin/src/Resources/views/sales/orders/view.blade.php @@ -157,37 +157,41 @@
- -
+ @if ($order->billing_address || $order->shipping_address) + +
-
-
- {{ __('admin::app.sales.orders.billing-address') }} -
+ @if($order->billing_address) +
+
+ {{ __('admin::app.sales.orders.billing-address') }} +
-
- @include ('admin::sales.address', ['address' => $order->billing_address]) +
+ @include ('admin::sales.address', ['address' => $order->billing_address]) + + {!! view_render_event('sales.order.billing_address.after', ['order' => $order]) !!} +
+
+ @endif + + @if ($order->shipping_address) +
+
+ {{ __('admin::app.sales.orders.shipping-address') }} +
+ +
+ @include ('admin::sales.address', ['address' => $order->shipping_address]) + + {!! view_render_event('sales.order.shipping_address.after', ['order' => $order]) !!} +
+
+ @endif - {!! view_render_event('sales.order.billing_address.after', ['order' => $order]) !!} -
- - @if ($order->shipping_address) -
-
- {{ __('admin::app.sales.orders.shipping-address') }} -
- -
- @include ('admin::sales.address', ['address' => $order->shipping_address]) - - {!! view_render_event('sales.order.shipping_address.after', ['order' => $order]) !!} -
-
- @endif - -
-
+ + @endif
@@ -470,7 +474,15 @@ {{ $invoice->created_at }} #{{ $invoice->order->increment_id }} {{ $invoice->address->name }} - {{ $invoice->status_label }} + + @if($invoice->state == "paid") + {{ __('admin::app.sales.orders.invoice-status-paid') }} + @elseif($invoice->state == "overdue") + {{ __('admin::app.sales.orders.invoice-status-overdue') }} + @else + {{ __('admin::app.sales.orders.invoice-status-pending') }} + @endif + {{ core()->formatBasePrice($invoice->base_grand_total) }} diff --git a/packages/Webkul/Admin/src/Resources/views/sales/refunds/view.blade.php b/packages/Webkul/Admin/src/Resources/views/sales/refunds/view.blade.php index c1d2762f2..8cefd98e8 100755 --- a/packages/Webkul/Admin/src/Resources/views/sales/refunds/view.blade.php +++ b/packages/Webkul/Admin/src/Resources/views/sales/refunds/view.blade.php @@ -107,37 +107,41 @@
- -
+ @if ($order->billing_address || $order->shipping_address) + +
-
-
- {{ __('admin::app.sales.orders.billing-address') }} -
+ @if ($order->billing_address) +
+
+ {{ __('admin::app.sales.orders.billing-address') }} +
-
+
- @include ('admin::sales.address', ['address' => $order->billing_address]) + @include ('admin::sales.address', ['address' => $order->billing_address]) + +
+
+ @endif + + @if ($order->shipping_address) +
+
+ {{ __('admin::app.sales.orders.shipping-address') }} +
+ +
+ + @include ('admin::sales.address', ['address' => $order->shipping_address]) + +
+
+ @endif -
- - @if ($order->shipping_address) -
-
- {{ __('admin::app.sales.orders.shipping-address') }} -
- -
- - @include ('admin::sales.address', ['address' => $order->shipping_address]) - -
-
- @endif - -
-
+ + @endif
diff --git a/packages/Webkul/BookingProduct/src/Repositories/BookingProductEventTicketRepository.php b/packages/Webkul/BookingProduct/src/Repositories/BookingProductEventTicketRepository.php index ce0a1a7f2..e43dd10f2 100644 --- a/packages/Webkul/BookingProduct/src/Repositories/BookingProductEventTicketRepository.php +++ b/packages/Webkul/BookingProduct/src/Repositories/BookingProductEventTicketRepository.php @@ -2,6 +2,7 @@ namespace Webkul\BookingProduct\Repositories; +use Illuminate\Support\Facades\Event; use Webkul\Core\Eloquent\Repository; use Illuminate\Support\Str; @@ -18,12 +19,16 @@ class BookingProductEventTicketRepository extends Repository } /** - * @param array $data - * @param \Webkul\BookingProduct\Contracts\BookingProduct $bookingProduct + * @param array $data + * @param \Webkul\BookingProduct\Contracts\BookingProduct $bookingProduct + * * @return void + * @throws \Prettus\Validator\Exceptions\ValidatorException */ - public function saveEventTickets($data, $bookingProduct) + public function saveEventTickets($data, $bookingProduct): void { + Event::dispatch('booking_product.booking.event-ticket.save.before', ['data' => $data, 'bookingProduct' => $bookingProduct]); + $previousTicketIds = $bookingProduct->event_tickets()->pluck('id'); if (isset($data['tickets'])) { @@ -54,7 +59,7 @@ class BookingProductEventTicketRepository extends Repository } if (Str::contains($ticketId, 'ticket_')) { - $this->create(array_merge([ + $ticket = $this->create(array_merge([ 'booking_product_id' => $bookingProduct->id, ], $ticketInputs)); } else { @@ -62,13 +67,18 @@ class BookingProductEventTicketRepository extends Repository $previousTicketIds->forget($index); } - $this->update($ticketInputs, $ticketId); + $ticket = $this->update($ticketInputs, $ticketId); } + + $savedTickets[$ticketId]['ticket'] = $ticket; + $savedTickets[$ticketId]['ticketInputs'] = $ticketInputs; } } foreach ($previousTicketIds as $previousTicketId) { $this->delete($previousTicketId); } + + Event::dispatch('booking_product.booking.event-ticket.save.after', ['tickets' => $savedTickets]); } } \ No newline at end of file diff --git a/packages/Webkul/Core/src/Helpers/Laravel5Helper.php b/packages/Webkul/Core/src/Helpers/Laravel5Helper.php index 31d7476ef..e327d76e0 100644 --- a/packages/Webkul/Core/src/Helpers/Laravel5Helper.php +++ b/packages/Webkul/Core/src/Helpers/Laravel5Helper.php @@ -7,8 +7,11 @@ namespace Webkul\Core\Helpers; use Faker\Factory; use Codeception\Module\Laravel5; +use Webkul\BookingProduct\Models\BookingProduct; +use Webkul\BookingProduct\Models\BookingProductEventTicket; use Webkul\Checkout\Models\Cart; use Webkul\Checkout\Models\CartItem; +use Webkul\Customer\Models\Customer; use Webkul\Product\Models\Product; use Webkul\Attribute\Models\Attribute; use Webkul\Checkout\Models\CartAddress; @@ -31,21 +34,19 @@ class Laravel5Helper extends Laravel5 public const SIMPLE_PRODUCT = 1; public const VIRTUAL_PRODUCT = 2; public const DOWNLOADABLE_PRODUCT = 3; + public const BOOKING_EVENT_PRODUCT = 4; /** * Returns the field name of the given attribute in which a value should be saved inside * the 'product_attribute_values' table. Depends on the type. * - * @param string $attribute + * @param string $type * * @return string|null * @part ORM */ public static function getAttributeFieldName(string $type): ?string { - - $attributes = []; - $possibleTypes = [ 'text' => 'text_value', 'select' => 'integer_value', @@ -60,7 +61,7 @@ class Laravel5Helper extends Laravel5 public function prepareCart(array $options = []): array { - $faker = \Faker\Factory::create(); + $faker = Factory::create(); $I = $this; @@ -108,7 +109,7 @@ class Laravel5Helper extends Laravel5 $cartItems = []; - $generatedCartItems = rand(3, 10); + $generatedCartItems = random_int(3, 10); for ($i = 2; $i <= $generatedCartItems; $i++) { $quantity = random_int(1, 10); @@ -178,6 +179,10 @@ class Laravel5Helper extends Laravel5 $I = $this; switch ($productType) { + case self::BOOKING_EVENT_PRODUCT: + $product = $I->haveBookingEventProduct($configs, $productStates); + break; + case self::DOWNLOADABLE_PRODUCT: $product = $I->haveDownloadableProduct($configs, $productStates); break; @@ -205,7 +210,6 @@ class Laravel5Helper extends Laravel5 $productStates = array_merge($productStates, ['simple']); } - /** @var Product $product */ $product = $I->createProduct($configs['productAttributes'] ?? [], $productStates); $I->createAttributeValues($product->id, $configs['attributeValues'] ?? []); @@ -222,7 +226,6 @@ class Laravel5Helper extends Laravel5 $productStates = array_merge($productStates, ['virtual']); } - /** @var Product $product */ $product = $I->createProduct($configs['productAttributes'] ?? [], $productStates); $I->createAttributeValues($product->id, $configs['attributeValues'] ?? []); @@ -239,7 +242,6 @@ class Laravel5Helper extends Laravel5 $productStates = array_merge($productStates, ['downloadable']); } - /** @var Product $product */ $product = $I->createProduct($configs['productAttributes'] ?? [], $productStates); $I->createAttributeValues($product->id, $configs['attributeValues'] ?? []); @@ -249,6 +251,22 @@ class Laravel5Helper extends Laravel5 return $product->refresh(); } + private function haveBookingEventProduct(array $configs = [], array $productStates = []): Product + { + $I = $this; + if (! in_array('booking', $productStates)) { + $productStates = array_merge($productStates, ['booking']); + } + + $product = $I->createProduct($configs['productAttributes'] ?? [], $productStates); + + $I->createAttributeValues($product->id, $configs['attributeValues'] ?? []); + + $I->createBookingEventProduct($product->id); + + return $product->refresh(); + } + private function createProduct(array $attributes = [], array $states = []): Product { return factory(Product::class)->states($states)->create($attributes); @@ -275,6 +293,18 @@ class Laravel5Helper extends Laravel5 ]); } + private function createBookingEventProduct(int $productId): void + { + $I = $this; + $bookingProduct = $I->have(BookingProduct::class, [ + 'product_id' => $productId, + ]); + + $I->have(BookingProductEventTicket::class, [ + 'booking_product_id' => $bookingProduct->id, + ]); + } + private function createAttributeValues(int $productId, array $attributeValues = []): void { $I = $this; @@ -295,7 +325,7 @@ class Laravel5Helper extends Laravel5 } - /** @var array $defaultAttributeValues + /** * Some defaults that should apply to all generated products. * By defaults products will be generated as saleable. * If you do not want this, this defaults can be overriden by $attributeValues. @@ -314,7 +344,7 @@ class Laravel5Helper extends Laravel5 'special_price' => null, 'price' => $faker->randomFloat(2, 1, 1000), 'weight' => '1.00', // necessary for shipping - 'brand' => AttributeOption::firstWhere('attribute_id', $brand->id)->id, + 'brand' => AttributeOption::query()->firstWhere('attribute_id', $brand->id)->id, ]; $attributeValues = array_merge($defaultAttributeValues, $attributeValues); diff --git a/packages/Webkul/Customer/src/Http/Controllers/CustomerController.php b/packages/Webkul/Customer/src/Http/Controllers/CustomerController.php index bd917284b..b33721b83 100755 --- a/packages/Webkul/Customer/src/Http/Controllers/CustomerController.php +++ b/packages/Webkul/Customer/src/Http/Controllers/CustomerController.php @@ -82,6 +82,7 @@ class CustomerController extends Controller */ public function update() { + $isPasswordChanged = false; $id = auth()->guard('customer')->user()->id; $this->validate(request(), [ @@ -104,6 +105,7 @@ class CustomerController extends Controller if (isset ($data['oldpassword'])) { if ($data['oldpassword'] != "" || $data['oldpassword'] != null) { if (Hash::check($data['oldpassword'], auth()->guard('customer')->user()->password)) { + $isPasswordChanged = true; $data['password'] = bcrypt($data['password']); } else { session()->flash('warning', trans('shop::app.customer.account.profile.unmatch')); @@ -119,6 +121,10 @@ class CustomerController extends Controller if ($customer = $this->customerRepository->update($data, $id)) { + if ($isPasswordChanged) { + Event::dispatch('user.admin.update-password', $customer); + } + Event::dispatch('customer.update.after', $customer); Session()->flash('success', trans('shop::app.customer.account.profile.edit-success')); @@ -150,7 +156,7 @@ class CustomerController extends Controller $orders = $customerRepository->all_orders->whereIn('status', ['pending', 'processing'])->first(); if ($orders) { - session()->flash('error', trans('admin::app.response.order-pending')); + session()->flash('error', trans('admin::app.response.order-pending', ['name' => 'Customer'])); return redirect()->route($this->_config['redirect']); } else { diff --git a/packages/Webkul/Customer/src/Notifications/CustomerUpdatePassword.php b/packages/Webkul/Customer/src/Notifications/CustomerUpdatePassword.php new file mode 100644 index 000000000..28ce81693 --- /dev/null +++ b/packages/Webkul/Customer/src/Notifications/CustomerUpdatePassword.php @@ -0,0 +1,43 @@ +customer = $customer; + } + + /** + * Build the message. + * + * @return $this + */ + public function build() + { + return $this->from(core()->getSenderEmailDetails()['email'], core()->getSenderEmailDetails()['name']) + ->to($this->customer->email, $this->customer->name) + ->subject(trans('shop::app.mail.update-password.subject')) + ->view('shop::emails.customer.update-password', ['user' => $this->customer]); + } +} \ No newline at end of file diff --git a/packages/Webkul/Customer/src/Repositories/CustomerRepository.php b/packages/Webkul/Customer/src/Repositories/CustomerRepository.php index 1dc4c9ea5..1e853476a 100755 --- a/packages/Webkul/Customer/src/Repositories/CustomerRepository.php +++ b/packages/Webkul/Customer/src/Repositories/CustomerRepository.php @@ -16,4 +16,36 @@ class CustomerRepository extends Repository { return 'Webkul\Customer\Contracts\Customer'; } + + /** + * Check if customer has order pending or processing. + * + * @param Webkul\Customer\Models\Customer + * @return boolean + */ + public function checkIfCustomerHasOrderPendingOrProcessing($customer) + { + return $customer->all_orders->pluck('status')->contains(function ($val) { + return $val === 'pending' || $val === 'processing'; + }); + } + + /** + * Check if bulk customers, if they have order pending or processing. + * + * @param array + * @return boolean + */ + public function checkBulkCustomerIfTheyHaveOrderPendingOrProcessing($customerIds) + { + foreach ($customerIds as $customerId) { + $customer = $this->findorFail($customerId); + + if ($this->checkIfCustomerHasOrderPendingOrProcessing($customer)) { + return true; + } + } + + return false; + } } \ No newline at end of file diff --git a/packages/Webkul/Product/src/Database/Factories/ProductFactory.php b/packages/Webkul/Product/src/Database/Factories/ProductFactory.php index e07b3169e..d0f4240b8 100644 --- a/packages/Webkul/Product/src/Database/Factories/ProductFactory.php +++ b/packages/Webkul/Product/src/Database/Factories/ProductFactory.php @@ -6,12 +6,8 @@ use Faker\Generator as Faker; use Webkul\Product\Models\Product; $factory->define(Product::class, function (Faker $faker) { - $now = date("Y-m-d H:i:s"); - return [ 'sku' => $faker->uuid, - 'created_at' => $now, - 'updated_at' => $now, 'attribute_family_id' => 1, ]; }); @@ -26,4 +22,8 @@ $factory->state(Product::class, 'virtual', [ $factory->state(Product::class, 'downloadable', [ 'type' => 'downloadable', +]); + +$factory->state(Product::class, 'booking', [ + 'type' => 'booking', ]); \ No newline at end of file diff --git a/packages/Webkul/Product/src/Type/Configurable.php b/packages/Webkul/Product/src/Type/Configurable.php index 393287536..c148ed62f 100644 --- a/packages/Webkul/Product/src/Type/Configurable.php +++ b/packages/Webkul/Product/src/Type/Configurable.php @@ -2,9 +2,10 @@ namespace Webkul\Product\Type; -use Webkul\Product\Models\ProductAttributeValue; -use Webkul\Product\Models\ProductFlat; use Illuminate\Support\Str; +use Illuminate\Support\Facades\DB; +use Webkul\Product\Models\ProductFlat; +use Webkul\Product\Models\ProductAttributeValue; class Configurable extends AbstractType { @@ -351,14 +352,16 @@ class Configurable extends AbstractType { $minPrices = []; + /* method is calling many time so using variable */ + $tablePrefix = DB::getTablePrefix(); + $result = ProductFlat::join('products', 'product_flat.product_id', '=', 'products.id') ->distinct() ->where('products.parent_id', $this->product->id) - ->selectRaw('IF( product_flat.special_price_from IS NOT NULL - AND product_flat.special_price_to IS NOT NULL , IF( NOW( ) >= product_flat.special_price_from - AND NOW( ) <= product_flat.special_price_to, IF( product_flat.special_price IS NULL OR product_flat.special_price = 0 , product_flat.price, LEAST( product_flat.special_price, product_flat.price ) ) , product_flat.price ) , IF( product_flat.special_price_from IS NULL , IF( product_flat.special_price_to IS NULL , IF( product_flat.special_price IS NULL OR product_flat.special_price = 0 , product_flat.price, LEAST( product_flat.special_price, product_flat.price ) ) , IF( NOW( ) <= product_flat.special_price_to, IF( product_flat.special_price IS NULL OR product_flat.special_price = 0 , product_flat.price, LEAST( product_flat.special_price, product_flat.price ) ) , product_flat.price ) ) , IF( product_flat.special_price_to IS NULL , IF( NOW( ) >= product_flat.special_price_from, IF( product_flat.special_price IS NULL OR product_flat.special_price = 0 , product_flat.price, LEAST( product_flat.special_price, product_flat.price ) ) , product_flat.price ) , product_flat.price ) ) ) AS min_price') + ->selectRaw("IF( {$tablePrefix}product_flat.special_price_from IS NOT NULL + AND {$tablePrefix}product_flat.special_price_to IS NOT NULL , IF( NOW( ) >= {$tablePrefix}product_flat.special_price_from + AND NOW( ) <= {$tablePrefix}product_flat.special_price_to, IF( {$tablePrefix}product_flat.special_price IS NULL OR {$tablePrefix}product_flat.special_price = 0 , {$tablePrefix}product_flat.price, LEAST( {$tablePrefix}product_flat.special_price, {$tablePrefix}product_flat.price ) ) , {$tablePrefix}product_flat.price ) , IF( {$tablePrefix}product_flat.special_price_from IS NULL , IF( {$tablePrefix}product_flat.special_price_to IS NULL , IF( {$tablePrefix}product_flat.special_price IS NULL OR {$tablePrefix}product_flat.special_price = 0 , {$tablePrefix}product_flat.price, LEAST( {$tablePrefix}product_flat.special_price, {$tablePrefix}product_flat.price ) ) , IF( NOW( ) <= {$tablePrefix}product_flat.special_price_to, IF( {$tablePrefix}product_flat.special_price IS NULL OR {$tablePrefix}product_flat.special_price = 0 , {$tablePrefix}product_flat.price, LEAST( {$tablePrefix}product_flat.special_price, {$tablePrefix}product_flat.price ) ) , {$tablePrefix}product_flat.price ) ) , IF( {$tablePrefix}product_flat.special_price_to IS NULL , IF( NOW( ) >= {$tablePrefix}product_flat.special_price_from, IF( {$tablePrefix}product_flat.special_price IS NULL OR {$tablePrefix}product_flat.special_price = 0 , {$tablePrefix}product_flat.price, LEAST( {$tablePrefix}product_flat.special_price, {$tablePrefix}product_flat.price ) ) , {$tablePrefix}product_flat.price ) , {$tablePrefix}product_flat.price ) ) ) AS min_price") ->where('product_flat.channel', core()->getCurrentChannelCode()) - ->where('product_flat.locale', app()->getLocale()) ->get(); foreach ($result as $price) { @@ -382,7 +385,7 @@ class Configurable extends AbstractType $productFlat = ProductFlat::join('products', 'product_flat.product_id', '=', 'products.id') ->distinct() ->where('products.parent_id', $this->product->id) - ->selectRaw('MAX(product_flat.price) AS max_price') + ->selectRaw('MAX('.DB::getTablePrefix().'product_flat.price) AS max_price') ->where('product_flat.channel', core()->getCurrentChannelCode()) ->where('product_flat.locale', app()->getLocale()) ->first(); diff --git a/packages/Webkul/Sales/src/Models/Order.php b/packages/Webkul/Sales/src/Models/Order.php index 32df169f6..8f90a3b55 100755 --- a/packages/Webkul/Sales/src/Models/Order.php +++ b/packages/Webkul/Sales/src/Models/Order.php @@ -277,6 +277,12 @@ class Order extends Model implements OrderContract return false; } + foreach ($this->invoices as $item) { + if ($item->state == "pending" || $item->state == "overdue") { + return false; + } + } + foreach ($this->items as $item) { if ($item->qty_to_refund > 0) { return true; diff --git a/packages/Webkul/Sales/src/Repositories/InvoiceRepository.php b/packages/Webkul/Sales/src/Repositories/InvoiceRepository.php index 8f4f605e6..70a3882ca 100755 --- a/packages/Webkul/Sales/src/Repositories/InvoiceRepository.php +++ b/packages/Webkul/Sales/src/Repositories/InvoiceRepository.php @@ -97,7 +97,7 @@ class InvoiceRepository extends Repository $invoice = $this->model->create([ 'order_id' => $order->id, 'total_qty' => $totalQty, - 'state' => 'paid', + 'state' => 'pending', 'base_currency_code' => $order->base_currency_code, 'channel_currency_code' => $order->channel_currency_code, 'order_currency_code' => $order->order_currency_code, @@ -106,7 +106,7 @@ class InvoiceRepository extends Repository foreach ($data['invoice']['items'] as $itemId => $qty) { if (! $qty) { - continue; + continue; } $orderItem = $this->orderItemRepository->find($itemId); @@ -192,11 +192,8 @@ class InvoiceRepository extends Repository } $this->collectTotals($invoice); - $this->orderRepository->collectTotals($order); - $this->orderRepository->updateOrderStatus($order); - Event::dispatch('sales.invoice.save.after', $invoice); } catch (\Exception $e) { DB::rollBack(); @@ -256,4 +253,16 @@ class InvoiceRepository extends Repository return $invoice; } + + /** + * @param \Webkul\Sales\Contracts\Invoice $invoice + * @return void + */ + public function updateInvoiceState($invoice, $status) + { + $invoice->state = $status; + $invoice->save(); + + return true; + } } \ No newline at end of file diff --git a/packages/Webkul/Shop/src/Resources/lang/ar/app.php b/packages/Webkul/Shop/src/Resources/lang/ar/app.php index e26883627..014e9ce1d 100644 --- a/packages/Webkul/Shop/src/Resources/lang/ar/app.php +++ b/packages/Webkul/Shop/src/Resources/lang/ar/app.php @@ -579,6 +579,15 @@ return [ 'final-summary' => 'شكرا لإظهارك إهتمامك بمتجرنا سنرسل لك رقم التتبع بمجرد شحنه', 'help' => ': support_email إذا كنت بحاجة إلى أي نوع من المساعدة يرجى الاتصال بنا على', 'thanks' => 'شكرا!', + + 'comment' => [ + 'subject' => '#:order_id تمت إضافة تعليق جديد إلى طلبك', + 'dear' => ':customer_name العزيز', + 'final-summary' => 'شكرا لإظهار اهتمامك بمتجرنا', + 'help' => ':support_email إذا كنت بحاجة إلى أي نوع من المساعدة يرجى الاتصال بنا على', + 'thanks' => 'شكر!', + ], + 'cancel' => [ 'subject' => 'تأكيد إلغاء الأمر', 'heading' => 'تم الغاء الأمر او الطلب', @@ -635,6 +644,13 @@ return [ 'thanks' => 'شكرا!' ], + 'update-password' => [ + 'subject' => 'تم تحديث كلمة السر', + 'dear' => ':name عزيزي', + 'info' => 'أنت تتلقى هذا البريد الإلكتروني لأنك قمت بتحديث كلمة المرور الخاصة بك.', + 'thanks' => 'شكرا!' + ], + 'customer' => [ 'new' => [ 'dear' => ':customer_name العزيز', diff --git a/packages/Webkul/Shop/src/Resources/lang/de/app.php b/packages/Webkul/Shop/src/Resources/lang/de/app.php index 52de95e10..087086960 100755 --- a/packages/Webkul/Shop/src/Resources/lang/de/app.php +++ b/packages/Webkul/Shop/src/Resources/lang/de/app.php @@ -573,6 +573,15 @@ return [ 'final-summary' => 'Vielen Dank für Ihr Interesse an unserem Shop. Nach dem Versand senden wir Ihnen die Sendungsverfolgungsnummer', 'help' => 'Wenn Sie Hilfe benötigen, kontaktieren Sie uns bitte unter :support_email', 'thanks' => 'Vielen Dank!', + + 'comment' => [ + 'subject' => 'Neuer Kommentar zu Ihrer Bestellung hinzugefügt #:order_id', + 'dear' => 'sehr geehrter :customer_name', + 'final-summary' => 'Vielen Dank für Ihr Interesse an unserem Shop', + 'help' => 'Wenn Sie Hilfe benötigen, kontaktieren Sie uns bitte unter :support_email', + 'thanks' => 'Vielen Dank!', + ], + 'cancel' => [ 'subject' => 'Bestätigung der Bestellungsstornierung', 'heading' => 'Bestellung storniert', @@ -629,6 +638,13 @@ return [ 'thanks' => 'Vielen Dank!' ], + 'update-password' => [ + 'subject' => 'Passwort aktualisiert', + 'dear' => 'Sehr geehrte/r :name', + 'info' => 'Sie erhalten diese E-Mail, weil Sie Ihr Passwort aktualisiert haben.', + 'thanks' => 'Vielen Dank!' + ], + 'customer' => [ 'new' => [ 'dear' => 'Sehr geehrte/r :customer_name', diff --git a/packages/Webkul/Shop/src/Resources/lang/en/app.php b/packages/Webkul/Shop/src/Resources/lang/en/app.php index e7af54764..ab15f52ad 100755 --- a/packages/Webkul/Shop/src/Resources/lang/en/app.php +++ b/packages/Webkul/Shop/src/Resources/lang/en/app.php @@ -581,7 +581,7 @@ return [ 'thanks' => 'Thanks!', 'comment' => [ - 'subject' => 'New comment added to your order', + 'subject' => 'New comment added to your order #:order_id', 'dear' => 'Dear :customer_name', 'final-summary' => 'Thanks for showing your interest in our store', 'help' => 'If you need any kind of help please contact us at :support_email', @@ -592,7 +592,7 @@ return [ 'subject' => 'Order Cancel Confirmation', 'heading' => 'Order Cancelled', 'dear' => 'Dear :customer_name', - 'greeting' => 'You Order with order id #:order_id placed on :created_at has been cancelled', + 'greeting' => 'Your Order with order id :order_id placed on :created_at has been cancelled', 'summary' => 'Summary of Order', 'shipping-address' => 'Shipping Address', 'billing-address' => 'Billing Address', @@ -644,6 +644,13 @@ return [ 'thanks' => 'Thanks!' ], + 'update-password' => [ + 'subject' => 'Password Updated', + 'dear' => 'Dear :name', + 'info' => 'You are receiving this email because you have updated your password.', + 'thanks' => 'Thanks!' + ], + 'customer' => [ 'new' => [ 'dear' => 'Dear :customer_name', diff --git a/packages/Webkul/Shop/src/Resources/lang/es/app.php b/packages/Webkul/Shop/src/Resources/lang/es/app.php index 3e9ef0f50..01f8e8856 100644 --- a/packages/Webkul/Shop/src/Resources/lang/es/app.php +++ b/packages/Webkul/Shop/src/Resources/lang/es/app.php @@ -538,6 +538,15 @@ return [ 'final-summary' => 'Gracias por tu pedido, te enviaremos el número de seguimiento una vez enviado', 'help' => 'Si necesitas ayuda contacta con nosotros a través de :support_email', 'thanks' => '¡Gracias!', + + 'comment' => [ + 'subject' => 'Nuevo comentario agregado a su pedido #:order_id', + 'dear' => 'Querida :customer_name', + 'final-summary' => 'Gracias por mostrar su interés en nuestra tienda.', + 'help' => 'Si necesita algún tipo de ayuda, contáctenos en :support_email', + 'thanks' => '¡Gracias!', + ], + 'cancel' => [ 'subject' => 'Confirmación de pedido cancelado', 'heading' => 'Pedido cancelado', @@ -582,6 +591,12 @@ return [ 'final-summary' => 'Si no has solicitado cambiar de contraseña, ninguna acción es requerida por tu parte.', 'thanks' => '¡Gracias!' ], + 'update-password' => [ + 'subject' => 'Contraseña actualiza', + 'dear' => 'Estimado/a :name', + 'info' => 'Está recibiendo este correo electrónico porque ha actualizado su contraseña.', + 'thanks' => '¡Gracias!' + ], 'customer' => [ 'new' => [ 'dear' => 'Estimado/a :customer_name', diff --git a/packages/Webkul/Shop/src/Resources/lang/fa/app.php b/packages/Webkul/Shop/src/Resources/lang/fa/app.php index 28e7c5709..02c289228 100644 --- a/packages/Webkul/Shop/src/Resources/lang/fa/app.php +++ b/packages/Webkul/Shop/src/Resources/lang/fa/app.php @@ -578,6 +578,15 @@ return [ 'final-summary' => 'با تشکر از علاقه شما به فروشگاه ما ، شماره حمل و نقل را برای شما ارسال می کنیم', 'help' => 'در صورت نیاز به هر نوع کمک ، لطفا با ما تماس بگیرید :support_email', 'thanks' => 'با تشکر!', + + 'comment' => [ + 'subject' => '#:order_id نظر جدیدی به سفارش شما اضافه شد', + 'dear' => ':customer_name عزیز', + 'final-summary' => 'با تشکر از علاقه شما به فروشگاه ما', + 'help' => ':support_email در صورت نیاز به هر نوع کمک ، لطفا با ما تماس بگیرید', + 'thanks' => 'با تشکر!', + ], + 'cancel' => [ 'subject' => 'تأیید سفارش را لغو کنید', 'heading' => 'سفارش لغو شد', @@ -634,6 +643,13 @@ return [ 'thanks' => 'با تشکر' ], + 'update-password' => [ + 'subject' => 'پسورد آپدیت شد', + 'dear' => ':name عزیز', + 'info' => 'شما این ایمیل را دریافت می کنید زیرا رمز خود را به روز کرده اید.', + 'thanks' => 'با تشکر' + ], + 'customer' => [ 'new' => [ 'dear' => ':customer_name عزیز', diff --git a/packages/Webkul/Shop/src/Resources/lang/it/app.php b/packages/Webkul/Shop/src/Resources/lang/it/app.php index 55716acb2..ef9bb77d1 100644 --- a/packages/Webkul/Shop/src/Resources/lang/it/app.php +++ b/packages/Webkul/Shop/src/Resources/lang/it/app.php @@ -580,7 +580,7 @@ return [ 'thanks' => 'Grazie!', 'comment' => [ - 'subject' => 'Nuovo commento aggiunto al tuo ordine', + 'subject' => 'Nuovo commento aggiunto al tuo ordine #:order_id', 'dear' => ':customer_name', 'final-summary' => 'Grazie per aver mostrato interesse per il nostro store', 'help' => 'Se hai bisogno di aiuto contattaci all\'indirizzo :support_email', @@ -643,6 +643,13 @@ return [ 'thanks' => 'Grazie!' ], + 'update-password' => [ + 'subject' => 'Password aggiornata', + 'dear' => 'Cara :name', + 'info' => 'Ricevi questa email perché hai aggiornato la password.', + 'thanks' => 'Grazie!' + ], + 'customer' => [ 'new' => [ 'dear' => 'Gentile :customer_name', @@ -675,7 +682,7 @@ return [ 'subject' => 'Email Iscrizione', 'greeting' => ' Benvenuto ' . config('app.name') . ' - Email Iscrizione', 'unsubscribe' => 'Cancellati', - 'summary' => 'Grazie per avere scelto di ricevere le nostre email. È passato un po\' di tempo da quando hai letto le email di ' . config('app.name') . '. Non è un nostro desidero inondare la tua casella email con le nostre comunicazioni. Se desideri comunque + 'summary' => 'Grazie per avere scelto di ricevere le nostre email. È passato un po\' di tempo da quando hai letto le email di ' . config('app.name') . '. Non è un nostro desidero inondare la tua casella email con le nostre comunicazioni. Se desideri comunque non ricevere più le nostre news clicca il bottone qui sotto.' ] ] diff --git a/packages/Webkul/Shop/src/Resources/lang/ja/app.php b/packages/Webkul/Shop/src/Resources/lang/ja/app.php index e4a461ae5..319779f83 100644 --- a/packages/Webkul/Shop/src/Resources/lang/ja/app.php +++ b/packages/Webkul/Shop/src/Resources/lang/ja/app.php @@ -529,7 +529,16 @@ return [ 'grand-total' => '合計', 'final-summary' => '発送手続き完了後、お知らせメールを配信いたしますので、今しばらくお待ちください。', 'help' => 'お問合せなどは下記メールアドレスへご連絡ください。:support_email', - 'thanks' => 'Gracias!', + 'thanks' => 'ありがとう!', + + 'comment' => [ + 'subject' => '注文に新しいコメントが追加されました #:order_id', + 'dear' => '親愛な :customer_name', + 'final-summary' => '当店へのご関心をお寄せいただきありがとうございます', + 'help' => '何か助けが必要な場合は、私たちに連絡してください :support_email', + 'thanks' => 'ありがとう!', + ], + 'cancel' => [ 'subject' => '注文がキャンセルされました', 'heading' => '注文がキャンセルされました', @@ -548,7 +557,7 @@ return [ 'grand-total' => '合計', 'final-summary' => '私たちのお店にお越しいただき、ありがとうございます。', 'help' => 'お問合せなどは下記メールアドレスへご連絡ください。 :support_email', - 'thanks' => 'Gracias!', + 'thanks' => 'ありがとう!', ] ], 'invoice' => [ @@ -574,6 +583,12 @@ return [ 'final-summary' => 'Si no has solicitado cambiar de contraseña, ninguna acción es requerida por tu parte.', 'thanks' => 'ありがとうございます。' ], + 'update-password' => [ + 'subject' => 'パスワードが更新されました', + 'dear' => '様 :name', + 'info' => 'パスワードを更新したため、このメールをお送りしています。', + 'thanks' => 'ありがとうございます。' + ], 'customer' => [ 'new' => [ 'dear' => '様 :customer_name', diff --git a/packages/Webkul/Shop/src/Resources/lang/nl/app.php b/packages/Webkul/Shop/src/Resources/lang/nl/app.php index 624d2ef56..781c3d476 100644 --- a/packages/Webkul/Shop/src/Resources/lang/nl/app.php +++ b/packages/Webkul/Shop/src/Resources/lang/nl/app.php @@ -582,7 +582,16 @@ return [ 'grand-total' => 'Eindtotaal', 'final-summary' => 'Bedankt voor het tonen van uw interesse in onze winkel.We sturen u een trackingnummer zodra het is verzonden', 'help' => 'Als u hulp nodig heeft, neem dan contact met ons op via :support_email', - 'thanks' => 'Thanks!', + 'thanks' => 'Bedankt!', + + 'comment' => [ + 'subject' => 'Nieuwe opmerking toegevoegd aan uw bestelling #:order_id', + 'dear' => 'Lieve :customer_name', + 'final-summary' => 'Bedankt voor het tonen van uw interesse in onze winkel', + 'help' => 'Als u hulp nodig heeft, neem dan contact met ons op via :support_email', + 'thanks' => 'Bedankt!', + ], + 'cancel' => [ 'subject' => 'Order Annuleren Bevestiging', 'heading' => 'Bestelling geannuleerd', @@ -639,6 +648,13 @@ return [ 'thanks' => 'Bedankt!' ], + 'update-password' => [ + 'subject' => 'Wachtwoord bijgewerkt', + 'dear' => 'Lieve :name', + 'info' => 'Je ontvangt deze e-mail omdat je je wachtwoord hebt bijgewerkt.', + 'thanks' => 'Bedankt!' + ], + 'customer' => [ 'new' => [ 'dear' => 'Lieve :customer_name', diff --git a/packages/Webkul/Shop/src/Resources/lang/pl/app.php b/packages/Webkul/Shop/src/Resources/lang/pl/app.php index 8681d7adb..c16c22ce8 100644 --- a/packages/Webkul/Shop/src/Resources/lang/pl/app.php +++ b/packages/Webkul/Shop/src/Resources/lang/pl/app.php @@ -577,6 +577,15 @@ return [ 'final-summary' => 'TDziękujemy za zainteresowanie naszym sklepem, a po podsumowaniu wyślemy ci numer śledzenia', 'help' => 'Jeśli potrzebujesz jakiejkolwiek pomocy, skontaktuj się z nami pod adresem :support_email', 'thanks' => 'Dzięki!', + + 'comment' => [ + 'subject' => 'Dodano nowy komentarz do Twojego zamówienia #:order_id', + 'dear' => 'Drogi :customer_name', + 'final-summary' => 'Dziękujemy za zainteresowanie naszym sklepem', + 'help' => 'Jeśli potrzebujesz pomocy, skontaktuj się z nami pod adresem :support_email', + 'thanks' => 'Dzięki!', + ], + 'cancel' => [ 'subject' => 'Potwierdź anulowanie zamówienia', 'heading' => 'Zamówienie anulowane', @@ -633,6 +642,13 @@ return [ 'thanks' => 'Dzięki!' ], + 'update-password' => [ + 'subject' => 'Hasło zaktualizowane', + 'dear' => 'Drogi/a :name', + 'info' => 'Otrzymujesz tę wiadomość e-mail, ponieważ zaktualizowałeś swoje hasło.', + 'thanks' => 'Dzięki!' + ], + 'customer' => [ 'new' => [ 'dear' => 'Drogi/a :customer_name', diff --git a/packages/Webkul/Shop/src/Resources/lang/pt_BR/app.php b/packages/Webkul/Shop/src/Resources/lang/pt_BR/app.php index 7857f8336..266ec6e97 100755 --- a/packages/Webkul/Shop/src/Resources/lang/pt_BR/app.php +++ b/packages/Webkul/Shop/src/Resources/lang/pt_BR/app.php @@ -554,6 +554,15 @@ return [ 'final-summary' => 'Obrigado por mostrar o seu interesse em nossa loja nós lhe enviaremos o número de rastreamento assim que for despachado', 'help' => 'Se você precisar de algum tipo de ajuda, por favor entre em contato conosco :support_email', 'thanks' => 'Muito Obrigado!', + + 'comment' => [ + 'subject' => 'Novo comentário adicionado ao seu pedido #: order_id', + 'dear' => 'Prezado :customer_name', + 'final-summary' => 'Obrigado por mostrar seu interesse em nossa loja', + 'help' => 'Se você precisar de algum tipo de ajuda, entre em contato conosco :support_email', + 'thanks' => 'Obrigada!', + ], + 'cancel' => [ 'subject' => 'Confirmação de Cancelamento de Pedido', 'heading' => 'Pedido Cancelado', @@ -607,6 +616,13 @@ return [ 'thanks' => 'Obrigado!' ], + 'update-password' => [ + 'subject' => 'Senha atualizada', + 'dear' => 'Caro :name', + 'info' => 'Você está recebendo este e-mail porque atualizou sua senha.', + 'thanks' => 'Obrigado!' + ], + 'customer' => [ 'new' => [ 'dear' => 'Caro :customer_name', diff --git a/packages/Webkul/Shop/src/Resources/lang/tr/app.php b/packages/Webkul/Shop/src/Resources/lang/tr/app.php index 91379b8ac..a6926e4ad 100644 --- a/packages/Webkul/Shop/src/Resources/lang/tr/app.php +++ b/packages/Webkul/Shop/src/Resources/lang/tr/app.php @@ -574,9 +574,9 @@ return [ 'final-summary' => 'Bizi tercih ettiğiniz için teşekkür ederiz. Ürün kargoya teslim edildikten sonra takip numarası iletilecektir.', 'help' => 'Soru ve görüşleriniz için lütfen bizimle iletişime geçiniz: :support_email', 'thanks' => 'Teşekkürler!', - + 'comment' => [ - 'subject' => 'Siparişinize yeni yorum yapıldı.', + 'subject' => 'Siparişinize #:order_id yeni yorum yapıldı.', 'dear' => 'Sayın :customer_name', 'final-summary' => 'Bizi tercih ettiğiniz için teşekkür ederiz.', 'help' => 'Soru ve görüşleriniz için lütfen bizimle iletişime geçiniz: :support_email', @@ -639,6 +639,13 @@ return [ 'thanks' => 'Teşekkürler!' ], + 'update-password' => [ + 'subject' => 'Şifre güncellendi', + 'dear' => 'Sayın :name', + 'info' => 'Bu e-postayı, şifrenizi güncellediğiniz için alıyorsunuz.', + 'thanks' => 'Teşekkürler!' + ], + 'customer' => [ 'new' => [ 'dear' => 'Sayın :customer_name', diff --git a/packages/Webkul/Shop/src/Resources/views/emails/admin/update-password.blade.php b/packages/Webkul/Shop/src/Resources/views/emails/admin/update-password.blade.php new file mode 100755 index 000000000..f1759daed --- /dev/null +++ b/packages/Webkul/Shop/src/Resources/views/emails/admin/update-password.blade.php @@ -0,0 +1,25 @@ +@component('shop::emails.layouts.master') + + +
+

+ {{ __('shop::app.mail.update-password.dear', ['name' => $user->name]) }}, +

+ +

+ {{ __('shop::app.mail.update-password.info') }} +

+ +

+ {{ __('shop::app.mail.update-password.thanks') }} +

+
+@endcomponent \ No newline at end of file diff --git a/packages/Webkul/Shop/src/Resources/views/emails/customer/update-password.blade.php b/packages/Webkul/Shop/src/Resources/views/emails/customer/update-password.blade.php new file mode 100755 index 000000000..4d616875f --- /dev/null +++ b/packages/Webkul/Shop/src/Resources/views/emails/customer/update-password.blade.php @@ -0,0 +1,21 @@ +@component('shop::emails.layouts.master') + + +
+

+ {{ __('shop::app.mail.update-password.dear', ['name' => $user->name]) }}, +

+ +

+ {{ __('shop::app.mail.update-password.info') }} +

+ +

+ {{ __('shop::app.mail.update-password.thanks') }} +

+
+@endcomponent \ No newline at end of file diff --git a/packages/Webkul/Shop/src/Resources/views/emails/sales/order-cancel-admin.blade.php b/packages/Webkul/Shop/src/Resources/views/emails/sales/order-cancel-admin.blade.php new file mode 100644 index 000000000..b768036de --- /dev/null +++ b/packages/Webkul/Shop/src/Resources/views/emails/sales/order-cancel-admin.blade.php @@ -0,0 +1,212 @@ +@component('shop::emails.layouts.master') + + +
+
+ + {{ __('shop::app.mail.order.cancel.heading') }} +
+ +

+ {{ __('shop::app.mail.order.cancel.dear', ['customer_name' => config('mail.from.name')]) }}, +

+ +

+ {!! __('shop::app.mail.order.cancel.greeting', [ + 'order_id' => '#' . $order->increment_id . '', + 'created_at' => $order->created_at + ]) + !!} +

+
+ +
+ {{ __('shop::app.mail.order.cancel.summary') }} +
+ +
+
+
+ {{ __('shop::app.mail.order.cancel.shipping-address') }} +
+ +
+ {{ $order->shipping_address->company_name ?? '' }} +
+ +
+ {{ $order->shipping_address->name }} +
+ +
+ {{ $order->shipping_address->address1 }}, {{ $order->shipping_address->state }} +
+ +
+ {{ core()->country_name($order->shipping_address->country) }} {{ $order->shipping_address->postcode }} +
+ +
---
+ +
+ {{ __('shop::app.mail.order.cancel.contact') }} : {{ $order->shipping_address->phone }} +
+ +
+ {{ __('shop::app.mail.order.cancel.shipping') }} +
+ +
+ {{ $order->shipping_title }} +
+
+ +
+
+ {{ __('shop::app.mail.order.cancel.billing-address') }} +
+ +
+ {{ $order->billing_address->company_name ?? '' }} +
+ +
+ {{ $order->billing_address->name }} +
+ +
+ {{ $order->billing_address->address1 }}, {{ $order->billing_address->state }} +
+ +
+ {{ core()->country_name($order->billing_address->country) }} {{ $order->billing_address->postcode }} +
+ +
---
+ +
+ {{ __('shop::app.mail.order.cancel.contact') }} : {{ $order->billing_address->phone }} +
+ +
+ {{ __('shop::app.mail.order.cancel.payment') }} +
+ +
+ {{ core()->getConfigData('sales.paymentmethods.' . $order->payment->method . '.title') }} +
+
+
+ +
+
+ + + + + + + + + + + + @foreach ($order->items as $item) + + + + + + + + + + @endforeach + +
{{ __('shop::app.customer.account.order.view.SKU') }}{{ __('shop::app.customer.account.order.view.product-name') }}{{ __('shop::app.customer.account.order.view.price') }}{{ __('shop::app.customer.account.order.view.qty') }}
+ {{ $item->child ? $item->child->sku : $item->sku }} + + {{ $item->name }} + + @if (isset($item->additional['attributes'])) +
+ + @foreach ($item->additional['attributes'] as $attribute) + {{ $attribute['attribute_name'] }} : {{ $attribute['option_label'] }}
+ @endforeach + +
+ @endif +
+ {{ core()->formatPrice($item->price, $order->order_currency_code) }} + + {{ $item->qty_canceled }} +
+
+
+ +
+
+ {{ __('shop::app.mail.order.cancel.subtotal') }} + + {{ core()->formatPrice($order->sub_total, $order->order_currency_code) }} + +
+ +
+ {{ __('shop::app.mail.order.cancel.shipping-handling') }} + + {{ core()->formatPrice($order->shipping_amount, $order->order_currency_code) }} + +
+ + @foreach (Webkul\Tax\Helpers\Tax::getTaxRatesWithAmount($order, false) as $taxRate => $taxAmount ) +
+ {{ __('shop::app.mail.order.cancel.tax') }} {{ $taxRate }} % + + {{ core()->formatPrice($taxAmount, $order->order_currency_code) }} + +
+ @endforeach + + @if ($order->discount_amount > 0) +
+ {{ __('shop::app.mail.order.cancel.discount') }} + + {{ core()->formatPrice($order->discount_amount, $order->order_currency_code) }} + +
+ @endif + +
+ {{ __('shop::app.mail.order.cancel.grand-total') }} + + {{ core()->formatPrice($order->grand_total, $order->order_currency_code) }} + +
+
+ +
+

+ {!! + __('shop::app.mail.order.cancel.help', [ + 'support_email' => '' . config('mail.from.address'). '' + ]) + !!} +

+ +

+ {{ __('shop::app.mail.order.cancel.thanks') }} +

+
+
+@endcomponent \ No newline at end of file diff --git a/packages/Webkul/Shop/src/Resources/views/products/view/grouped-products.blade.php b/packages/Webkul/Shop/src/Resources/views/products/view/grouped-products.blade.php index e6c2259ea..1f2b36dcc 100644 --- a/packages/Webkul/Shop/src/Resources/views/products/view/grouped-products.blade.php +++ b/packages/Webkul/Shop/src/Resources/views/products/view/grouped-products.blade.php @@ -10,22 +10,24 @@ {{ __('shop::app.products.qty') }} @foreach ($product->grouped_products as $groupedProduct) -
  • - - {{ $groupedProduct->associated_product->name }} + @if($groupedProduct->associated_product->getTypeInstance()->isSaleable()) +
  • + + {{ $groupedProduct->associated_product->name }} - @include ('shop::products.price', ['product' => $groupedProduct->associated_product]) - + @include ('shop::products.price', ['product' => $groupedProduct->associated_product]) + - - - - -
  • + + + + + + @endif @endforeach
    diff --git a/packages/Webkul/Ui/src/Resources/views/datagrid/table.blade.php b/packages/Webkul/Ui/src/Resources/views/datagrid/table.blade.php index 845658344..b1875d9a9 100644 --- a/packages/Webkul/Ui/src/Resources/views/datagrid/table.blade.php +++ b/packages/Webkul/Ui/src/Resources/views/datagrid/table.blade.php @@ -8,22 +8,9 @@ @push('scripts')