diff --git a/config/debugbar.php b/config/debugbar.php index c7c9ceee3..72ccd7bd3 100755 --- a/config/debugbar.php +++ b/config/debugbar.php @@ -143,7 +143,7 @@ return [ 'timeline' => false, // Add the queries to the timeline 'explain' => [ // Show EXPLAIN output on queries 'enabled' => false, - 'types' => ['SELECT'], // ['SELECT', 'INSERT', 'UPDATE', 'DELETE']; for MySQL 5.6.3+ + 'types' => ['SELECT'], // // workaround ['SELECT'] only. https://github.com/barryvdh/laravel-debugbar/issues/888 ['SELECT', 'INSERT', 'UPDATE', 'DELETE']; for MySQL 5.6.3+ ], 'hints' => true, // Show hints for common mistakes ], diff --git a/config/excel.php b/config/excel.php index af3e8bb99..37695184f 100755 --- a/config/excel.php +++ b/config/excel.php @@ -3,6 +3,7 @@ use Maatwebsite\Excel\Excel; return [ + 'exports' => [ /* @@ -16,17 +17,6 @@ return [ */ 'chunk_size' => 1000, - /* - |-------------------------------------------------------------------------- - | Temporary path - |-------------------------------------------------------------------------- - | - | When exporting files, we use a temporary file, before storing - | or downloading. Here you can customize that path. - | - */ - 'temp_path' => sys_get_temp_dir(), - /* |-------------------------------------------------------------------------- | Pre-calculate formulas during export @@ -69,6 +59,23 @@ return [ */ 'formatter' => 'slug', ], + + /* + |-------------------------------------------------------------------------- + | CSV Settings + |-------------------------------------------------------------------------- + | + | Configure e.g. delimiter, enclosure and line ending for CSV imports. + | + */ + 'csv' => [ + 'delimiter' => ',', + 'enclosure' => '"', + 'line_ending' => PHP_EOL, + 'use_bom' => false, + 'include_separator_line' => false, + 'excel_compatibility' => false, + ], ], /* @@ -109,4 +116,71 @@ return [ */ 'pdf' => Excel::DOMPDF, ], + + 'value_binder' => [ + + /* + |-------------------------------------------------------------------------- + | Default Value Binder + |-------------------------------------------------------------------------- + | + | PhpSpreadsheet offers a way to hook into the process of a value being + | written to a cell. In there some assumptions are made on how the + | value should be formatted. If you want to change those defaults, + | you can implement your own default value binder. + | + */ + 'default' => Maatwebsite\Excel\DefaultValueBinder::class, + ], + + 'transactions' => [ + + /* + |-------------------------------------------------------------------------- + | Transaction Handler + |-------------------------------------------------------------------------- + | + | By default the import is wrapped in a transaction. This is useful + | for when an import may fail and you want to retry it. With the + | transactions, the previous import gets rolled-back. + | + | You can disable the transaction handler by setting this to null. + | Or you can choose a custom made transaction handler here. + | + | Supported handlers: null|db + | + */ + 'handler' => 'db', + ], + + 'temporary_files' => [ + + /* + |-------------------------------------------------------------------------- + | Local Temporary Path + |-------------------------------------------------------------------------- + | + | When exporting and importing files, we use a temporary file, before + | storing reading or downloading. Here you can customize that path. + | + */ + 'local_path' => sys_get_temp_dir(), + + /* + |-------------------------------------------------------------------------- + | Remote Temporary Disk + |-------------------------------------------------------------------------- + | + | When dealing with a multi server setup with queues in which you + | cannot rely on having a shared local temporary path, you might + | want to store the temporary file on a shared disk. During the + | queue executing, we'll retrieve the temporary file from that + | location instead. When left to null, it will always use + | the local path. This setting only has effect when using + | in conjunction with queued imports and exports. + | + */ + 'remote_disk' => null, + + ], ]; diff --git a/config/tinker.php b/config/tinker.php index 181f0fdbd..0d2bf00e7 100755 --- a/config/tinker.php +++ b/config/tinker.php @@ -28,6 +28,8 @@ return [ | */ - 'dont_alias' => [], + 'dont_alias' => [ + 'App\Nova', + ], ]; diff --git a/config/translatable.php b/config/translatable.php index 17bf04aac..87f898b4e 100755 --- a/config/translatable.php +++ b/config/translatable.php @@ -39,6 +39,8 @@ return [ | As a default locale, Translatable takes the locale of Laravel's | translator. If for some reason you want to override this, | you can specify what default should be used here. + | If you set a value here it will only use the current config value + | and never fallback to the translator one. | */ 'locale' => null, @@ -54,7 +56,7 @@ return [ | $useTranslationFallback when defined | */ - 'use_fallback' => true, + 'use_fallback' => false, /* |-------------------------------------------------------------------------- @@ -80,6 +82,18 @@ return [ */ 'fallback_locale' => 'en', + /* + |-------------------------------------------------------------------------- + | Translation Model Namespace + |-------------------------------------------------------------------------- + | + | Defines the default 'Translation' class namespace. For example, if + | you want to use App\Translations\CountryTranslation instead of App\CountryTranslation + | set this to 'App\Translations'. + | + */ + 'translation_model_namespace' => null, + /* |-------------------------------------------------------------------------- | Translation Suffix @@ -113,4 +127,4 @@ return [ | */ 'to_array_always_loads_translations' => true, -]; \ No newline at end of file +]; diff --git a/config/trustedproxy.php b/config/trustedproxy.php index acda8d51a..e242b0da5 100755 --- a/config/trustedproxy.php +++ b/config/trustedproxy.php @@ -15,19 +15,20 @@ return [ * of your proxy (e.g. if using ELB or similar). * */ - 'proxies' => null, // [,], '*' + 'proxies' => null, // [,], '*', ',' /* * To trust one or more specific proxies that connect - * directly to your server, use an array of IP addresses: + * directly to your server, use an array or a string separated by comma of IP addresses: */ - # 'proxies' => ['192.168.1.1'], + // 'proxies' => ['192.168.1.1'], + // 'proxies' => '192.168.1.1, 192.168.1.2', /* * Or, to trust all proxies that connect * directly to your server, use a "*" */ - # 'proxies' => '*', + // 'proxies' => '*', /* * Which headers to use to detect proxy related data (For, Host, Proto, Port) @@ -36,10 +37,14 @@ return [ * * - 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) + * - Illuminate\Http\Request::HEADER_X_FORWARDED_AWS_ELB (If you are using AWS Elastic Load Balancer) + * + * - 'HEADER_X_FORWARDED_ALL' (use all x-forwarded-* headers to establish trust) + * - 'HEADER_FORWARDED' (use the FORWARDED header to establish trust) + * - 'HEADER_X_FORWARDED_AWS_ELB' (If you are using AWS Elastic Load Balancer) * * @link https://symfony.com/doc/current/deployment/proxies.html */ 'headers' => Illuminate\Http\Request::HEADER_X_FORWARDED_ALL, - ]; 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..759572152 100755 --- a/packages/Webkul/Shop/src/Resources/lang/en/app.php +++ b/packages/Webkul/Shop/src/Resources/lang/en/app.php @@ -479,11 +479,12 @@ 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', 'subject' => 'Shipment for your 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..1b86b2525 --- /dev/null +++ b/packages/Webkul/Shop/src/Resources/views/emails/sales/new-inventorysource-shipment.blade.php @@ -0,0 +1,145 @@ +@component('shop::emails.layouts.master') +
+ + + +
+ + order; ?> + inventory_source; ?> + +
+
+ + {{ __('shop::app.mail.shipment.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) + + + + + + + @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-shipment.blade.php b/packages/Webkul/Shop/src/Resources/views/emails/sales/new-shipment.blade.php index f05837942..811fd20b4 100755 --- a/packages/Webkul/Shop/src/Resources/views/emails/sales/new-shipment.blade.php +++ b/packages/Webkul/Shop/src/Resources/views/emails/sales/new-shipment.blade.php @@ -21,7 +21,7 @@ {!! __('shop::app.mail.order.greeting', [ 'order_id' => '#' . $order->id . '', 'created_at' => $order->created_at - ]) + ]) !!}

@@ -51,7 +51,7 @@
---
- {{ __('shop::app.mail.order.contact') }} : {{ $order->shipping_address->phone }} + {{ __('shop::app.mail.order.contact') }} : {{ $order->shipping_address->phone }}
@@ -93,7 +93,7 @@
---
- {{ __('shop::app.mail.order.contact') }} : {{ $order->billing_address->phone }} + {{ __('shop::app.mail.order.contact') }} : {{ $order->billing_address->phone }}
@@ -106,46 +106,39 @@
- @foreach ($shipment->items as $item) -
-

- {{ $item->name }} -

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

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