diff --git a/config/debugbar.php b/config/debugbar.php index 8350e1c8d..0d8a281ba 100755 --- a/config/debugbar.php +++ b/config/debugbar.php @@ -9,7 +9,7 @@ return [ | | Debugbar is enabled by default, when debug is set to true in app.php. | You can override the value by setting enable to true or false instead of null. - | + | | You can provide an array of URI's that must be ignored (eg. 'api/*') | */ @@ -79,7 +79,7 @@ return [ | */ 'error_handler' => false, - + /* |-------------------------------------------------------------------------- | Clockwork integration @@ -198,4 +198,4 @@ return [ | To override default domain, specify it as a non-empty value. */ 'route_domain' => null, -]; +]; \ No newline at end of file diff --git a/config/excel.php b/config/excel.php index af3e8bb99..28cf95fd1 100755 --- a/config/excel.php +++ b/config/excel.php @@ -109,4 +109,4 @@ return [ */ 'pdf' => Excel::DOMPDF, ], -]; +]; \ No newline at end of file diff --git a/config/tinker.php b/config/tinker.php index 1341c1b03..2405c8b0a 100755 --- a/config/tinker.php +++ b/config/tinker.php @@ -15,4 +15,4 @@ return [ 'dont_alias' => [], -]; +]; \ No newline at end of file diff --git a/config/trustedproxy.php b/config/trustedproxy.php index acda8d51a..6f8257058 100755 --- a/config/trustedproxy.php +++ b/config/trustedproxy.php @@ -31,15 +31,15 @@ return [ /* * Which headers to use to detect proxy related data (For, Host, Proto, Port) - * + * * Options include: - * + * * - Illuminate\Http\Request::HEADER_X_FORWARDED_ALL (use all x-forwarded-* headers to establish trust) * - Illuminate\Http\Request::HEADER_FORWARDED (use the FORWARDED header to establish trust) - * + * * @link https://symfony.com/doc/current/deployment/proxies.html */ 'headers' => Illuminate\Http\Request::HEADER_X_FORWARDED_ALL, - -]; + +]; \ No newline at end of file diff --git a/packages/Webkul/Admin/src/Listeners/Order.php b/packages/Webkul/Admin/src/Listeners/Order.php index 377b4fbdd..bd4df32cc 100755 --- a/packages/Webkul/Admin/src/Listeners/Order.php +++ b/packages/Webkul/Admin/src/Listeners/Order.php @@ -6,6 +6,7 @@ use Illuminate\Support\Facades\Mail; use Webkul\Admin\Mail\NewOrderNotification; use Webkul\Admin\Mail\NewInvoiceNotification; use Webkul\Admin\Mail\NewShipmentNotification; +use Webkul\Admin\Mail\NewInventorySourceNotification; /** * Order event handler @@ -18,7 +19,7 @@ class Order { /** * @param mixed $order * - * Send new order confirmation mail to the customer + * Send new shipment mail to the customer and inventory source */ public function sendNewOrderMail($order) { @@ -52,6 +53,8 @@ class Order { { try { Mail::send(new NewShipmentNotification($shipment)); + + Mail::send(new NewInventorySourceNotification($shipment)); } catch (\Exception $e) { } diff --git a/packages/Webkul/Admin/src/Mail/NewInventorySourceNotification.php b/packages/Webkul/Admin/src/Mail/NewInventorySourceNotification.php new file mode 100644 index 000000000..7fda9cd25 --- /dev/null +++ b/packages/Webkul/Admin/src/Mail/NewInventorySourceNotification.php @@ -0,0 +1,51 @@ + + * @copyright 2018 Webkul Software Pvt Ltd (http://www.webkul.com) + */ +class NewInventorySourceNotification extends Mailable +{ + use Queueable, SerializesModels; + + /** + * The shipment instance. + * + * @var Shipment + */ + public $shipment; + + /** + * Create a new message instance. + * + * @param mixed $shipment + * @return void + */ + public function __construct($shipment) + { + $this->shipment = $shipment; + } + + /** + * Build the message. + * + * @return $this + */ + public function build() + { $order = $this->shipment->order; + $inventory = $this->shipment->inventory_source; + + return $this->to($inventory->contact_email, $inventory->name) + ->subject(trans('shop::app.mail.shipment.subject', ['order_id' => $order->id])) + ->view('shop::emails.sales.new-inventorysource-shipment'); + } +} diff --git a/packages/Webkul/Shop/src/Resources/lang/en/app.php b/packages/Webkul/Shop/src/Resources/lang/en/app.php index 5eea36989..dac33cd0b 100755 --- a/packages/Webkul/Shop/src/Resources/lang/en/app.php +++ b/packages/Webkul/Shop/src/Resources/lang/en/app.php @@ -461,8 +461,8 @@ return [ 'shipping-address' => 'Shipping Address', 'billing-address' => 'Billing Address', 'contact' => 'Contact', - 'shipping' => 'Shipping', - 'payment' => 'Payment', + 'shipping' => 'Shipping Method', + 'payment' => 'Payment Method', 'price' => 'Price', 'quantity' => 'Quantity', 'subtotal' => 'Subtotal', @@ -479,11 +479,14 @@ return [ 'summary' => 'Summary of Invoice', ], 'shipment' => [ - 'heading' => 'Your Shipment #:shipment_id for Order #:order_id', + 'heading' => 'Shipment #:shipment_id has been generated for Order #:order_id', + 'inventory-heading' => 'New Shipment #:shipment_id had been generated for Order #:order_id', 'subject' => 'Shipment for your order #:order_id', + 'inventory-subject' => 'New Shipment had been generated for Order #:order_id', 'summary' => 'Summary of Shipment', 'carrier' => 'Carrier', - 'tracking-number' => 'Tracking Number' + 'tracking-number' => 'Tracking Number', + 'greeting' => 'An Order :order_id has been placed on :created_at', ], 'forget-password' => [ 'dear' => 'Dear :name', diff --git a/packages/Webkul/Shop/src/Resources/views/emails/sales/new-inventorysource-shipment.blade.php b/packages/Webkul/Shop/src/Resources/views/emails/sales/new-inventorysource-shipment.blade.php new file mode 100644 index 000000000..345115895 --- /dev/null +++ b/packages/Webkul/Shop/src/Resources/views/emails/sales/new-inventorysource-shipment.blade.php @@ -0,0 +1,153 @@ +@component('shop::emails.layouts.master') +
+ + + +
+ + order; ?> + inventory_source; ?> + +
+
+ + {{ __('shop::app.mail.shipment.inventory-heading', ['order_id' => $order->id, 'shipment_id' => $shipment->id]) }} +
+ +

+ {{ __('shop::app.mail.order.dear', ['customer_name' => $inventory->name]) }}, +

+ +

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

+
+ + + +
+
+
+ {{ __('shop::app.mail.order.shipping-address') }} +
+ +
+ {{ $order->shipping_address->name }} +
+ +
+ {{ $order->shipping_address->address1 }}, {{ $order->shipping_address->state }} +
+ +
+ {{ country()->name($order->shipping_address->country) }} {{ $order->shipping_address->postcode }} +
+ +
---
+ +
+ {{ __('shop::app.mail.order.contact') }} : {{ $order->shipping_address->phone }} +
+ +
+ {{ __('shop::app.mail.order.shipping') }} +
+ +
+
+ {{ $order->shipping_title }} +
+ +
+ {{ __('shop::app.mail.shipment.carrier') }} : {{ $shipment->carrier_title }} +
+ +
+ {{ __('shop::app.mail.shipment.tracking-number') }} : {{ $shipment->track_number }} +
+
+
+ +
+
+ {{ __('shop::app.mail.order.billing-address') }} +
+ +
+ {{ $order->billing_address->name }} +
+ +
+ {{ $order->billing_address->address1 }}, {{ $order->billing_address->state }} +
+ +
+ {{ country()->name($order->billing_address->country) }} {{ $order->billing_address->postcode }} +
+ +
---
+ +
+ {{ __('shop::app.mail.order.contact') }} : {{ $order->billing_address->phone }} +
+ +
+ {{ __('shop::app.mail.order.payment') }} +
+ +
+ {{ core()->getConfigData('sales.paymentmethods.' . $order->payment->method . '.title') }} +
+
+
+ +
+
+ + + + + + + + + + + + @foreach ($shipment->items as $item) + + + + + + + + @if ($html = $item->getOptionDetailHtml()) +
+ +
+ @endif + @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 }}{{ core()->formatPrice($item->price, $order->order_currency_code) }}{{ $item->qty }}
+
+
+ + {{--
+

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

+
--}} +
+@endcomponent \ No newline at end of file diff --git a/packages/Webkul/Shop/src/Resources/views/emails/sales/new-order.blade.php b/packages/Webkul/Shop/src/Resources/views/emails/sales/new-order.blade.php index daf9654b5..8095cc78a 100755 --- a/packages/Webkul/Shop/src/Resources/views/emails/sales/new-order.blade.php +++ b/packages/Webkul/Shop/src/Resources/views/emails/sales/new-order.blade.php @@ -19,7 +19,7 @@ {!! __('shop::app.mail.order.greeting', [ 'order_id' => '#' . $order->id . '', 'created_at' => $order->created_at - ]) + ]) !!}

@@ -49,7 +49,7 @@
---
- {{ __('shop::app.mail.order.contact') }} : {{ $order->shipping_address->phone }} + {{ __('shop::app.mail.order.contact') }} : {{ $order->shipping_address->phone }}
@@ -81,7 +81,7 @@
---
- {{ __('shop::app.mail.order.contact') }} : {{ $order->billing_address->phone }} + {{ __('shop::app.mail.order.contact') }} : {{ $order->billing_address->phone }}
@@ -117,7 +117,7 @@ {{ $item->qty_ordered }}
- + @if ($html = $item->getOptionDetailHtml())
@@ -51,10 +51,10 @@
---
- {{ __('shop::app.mail.order.contact') }} : {{ $order->shipping_address->phone }} + {{ __('shop::app.mail.order.contact') }} : {{ $order->shipping_address->phone }}
-
+
{{ __('shop::app.mail.order.shipping') }}
@@ -93,10 +93,10 @@
---
- {{ __('shop::app.mail.order.contact') }} : {{ $order->billing_address->phone }} + {{ __('shop::app.mail.order.contact') }} : {{ $order->billing_address->phone }}
-
+
{{ __('shop::app.mail.order.payment') }}
@@ -106,46 +106,48 @@
- @foreach ($shipment->items as $item) -
-

- {{ $item->name }} -

+
+
+ + + + + + + + + -
- - - {{ core()->formatPrice($item->price, $order->order_currency_code) }} - -
+ + @foreach ($shipment->items as $item) + + + + + -
- - - {{ $item->qty }} - -
- - @if ($html = $item->getOptionDetailHtml()) -
- -
- @endif + @if ($html = $item->getOptionDetailHtml()) +
+ +
+ @endif + + + @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 }}{{ core()->formatPrice($item->price, $order->order_currency_code) }}{{ $item->qty }}
- @endforeach +

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