Merge branch 'master' of https://github.com/bagisto/bagisto into development

This commit is contained in:
rahul shukla 2019-04-10 15:08:15 +05:30
commit 2a859b7e23
10 changed files with 270 additions and 58 deletions

View File

@ -9,7 +9,7 @@ return [
| |
| Debugbar is enabled by default, when debug is set to true in app.php. | 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 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/*') | You can provide an array of URI's that must be ignored (eg. 'api/*')
| |
*/ */
@ -79,7 +79,7 @@ return [
| |
*/ */
'error_handler' => false, 'error_handler' => false,
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| Clockwork integration | Clockwork integration
@ -198,4 +198,4 @@ return [
| To override default domain, specify it as a non-empty value. | To override default domain, specify it as a non-empty value.
*/ */
'route_domain' => null, 'route_domain' => null,
]; ];

View File

@ -109,4 +109,4 @@ return [
*/ */
'pdf' => Excel::DOMPDF, 'pdf' => Excel::DOMPDF,
], ],
]; ];

View File

@ -15,4 +15,4 @@ return [
'dont_alias' => [], 'dont_alias' => [],
]; ];

View File

@ -31,15 +31,15 @@ return [
/* /*
* Which headers to use to detect proxy related data (For, Host, Proto, Port) * Which headers to use to detect proxy related data (For, Host, Proto, Port)
* *
* Options include: * Options include:
* *
* - Illuminate\Http\Request::HEADER_X_FORWARDED_ALL (use all x-forwarded-* headers to establish trust) * - 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_FORWARDED (use the FORWARDED header to establish trust)
* *
* @link https://symfony.com/doc/current/deployment/proxies.html * @link https://symfony.com/doc/current/deployment/proxies.html
*/ */
'headers' => Illuminate\Http\Request::HEADER_X_FORWARDED_ALL, 'headers' => Illuminate\Http\Request::HEADER_X_FORWARDED_ALL,
]; ];

View File

@ -6,6 +6,7 @@ use Illuminate\Support\Facades\Mail;
use Webkul\Admin\Mail\NewOrderNotification; use Webkul\Admin\Mail\NewOrderNotification;
use Webkul\Admin\Mail\NewInvoiceNotification; use Webkul\Admin\Mail\NewInvoiceNotification;
use Webkul\Admin\Mail\NewShipmentNotification; use Webkul\Admin\Mail\NewShipmentNotification;
use Webkul\Admin\Mail\NewInventorySourceNotification;
/** /**
* Order event handler * Order event handler
@ -18,7 +19,7 @@ class Order {
/** /**
* @param mixed $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) public function sendNewOrderMail($order)
{ {
@ -52,6 +53,8 @@ class Order {
{ {
try { try {
Mail::send(new NewShipmentNotification($shipment)); Mail::send(new NewShipmentNotification($shipment));
Mail::send(new NewInventorySourceNotification($shipment));
} catch (\Exception $e) { } catch (\Exception $e) {
} }

View File

@ -0,0 +1,51 @@
<?php
namespace Webkul\Admin\Mail;
use Illuminate\Bus\Queueable;
use Illuminate\Mail\Mailable;
use Illuminate\Queue\SerializesModels;
use Illuminate\Contracts\Queue\ShouldQueue;
/**
* New InventorySource Notification Mail class
*
* @author Jitendra Singh <jitendra@webkul.com>
* @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');
}
}

View File

@ -461,8 +461,8 @@ return [
'shipping-address' => 'Shipping Address', 'shipping-address' => 'Shipping Address',
'billing-address' => 'Billing Address', 'billing-address' => 'Billing Address',
'contact' => 'Contact', 'contact' => 'Contact',
'shipping' => 'Shipping', 'shipping' => 'Shipping Method',
'payment' => 'Payment', 'payment' => 'Payment Method',
'price' => 'Price', 'price' => 'Price',
'quantity' => 'Quantity', 'quantity' => 'Quantity',
'subtotal' => 'Subtotal', 'subtotal' => 'Subtotal',
@ -479,11 +479,14 @@ return [
'summary' => 'Summary of Invoice', 'summary' => 'Summary of Invoice',
], ],
'shipment' => [ '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', 'subject' => 'Shipment for your order #:order_id',
'inventory-subject' => 'New Shipment had been generated for Order #:order_id',
'summary' => 'Summary of Shipment', 'summary' => 'Summary of Shipment',
'carrier' => 'Carrier', 'carrier' => 'Carrier',
'tracking-number' => 'Tracking Number' 'tracking-number' => 'Tracking Number',
'greeting' => 'An Order :order_id has been placed on :created_at',
], ],
'forget-password' => [ 'forget-password' => [
'dear' => 'Dear :name', 'dear' => 'Dear :name',

View File

@ -0,0 +1,153 @@
@component('shop::emails.layouts.master')
<div style="text-align: center;">
<a href="{{ config('app.url') }}">
<img src="{{ bagisto_asset('images/logo.svg') }}">
</a>
</div>
<?php $order = $shipment->order; ?>
<?php $inventory = $shipment->inventory_source; ?>
<div style="padding: 30px;">
<div style="font-size: 20px;color: #242424;line-height: 30px;margin-bottom: 34px;">
<span style="font-weight: bold;">
{{ __('shop::app.mail.shipment.inventory-heading', ['order_id' => $order->id, 'shipment_id' => $shipment->id]) }}
</span> <br>
<p style="font-size: 16px;color: #5E5E5E;line-height: 24px;">
{{ __('shop::app.mail.order.dear', ['customer_name' => $inventory->name]) }},
</p>
<p style="font-size: 16px;color: #5E5E5E;line-height: 24px;">
{!! __('shop::app.mail.shipment.greeting', [
'order_id' => '<a href="' . route('customer.orders.view', $order->id) . '" style="color: #0041FF; font-weight: bold;">#' . $order->id . '</a>',
'created_at' => $order->created_at
])
!!}
</p>
</div>
<div style="display: flex;flex-direction: row;margin-top: 20px;justify-content: space-between;margin-bottom: 40px;">
<div style="line-height: 25px;">
<div style="font-weight: bold;font-size: 16px;color: #242424;">
{{ __('shop::app.mail.order.shipping-address') }}
</div>
<div>
{{ $order->shipping_address->name }}
</div>
<div>
{{ $order->shipping_address->address1 }}, {{ $order->shipping_address->state }}
</div>
<div>
{{ country()->name($order->shipping_address->country) }} {{ $order->shipping_address->postcode }}
</div>
<div>---</div>
<div style="margin-bottom: 40px;">
{{ __('shop::app.mail.order.contact') }} : {{ $order->shipping_address->phone }}
</div>
<div style="font-weight: bold;font-size: 16px;color: #242424;">
{{ __('shop::app.mail.order.shipping') }}
</div>
<div style="font-size: 16px;color: #242424;">
<div style="font-weight: bold;">
{{ $order->shipping_title }}
</div>
<div style="margin-top: 5px;">
<span style="font-weight: bold;">{{ __('shop::app.mail.shipment.carrier') }} : </span>{{ $shipment->carrier_title }}
</div>
<div style="margin-top: 5px;">
<span style="font-weight: bold;">{{ __('shop::app.mail.shipment.tracking-number') }} : </span>{{ $shipment->track_number }}
</div>
</div>
</div>
<div style="line-height: 25px;">
<div style="font-weight: bold;font-size: 16px;color: #242424;">
{{ __('shop::app.mail.order.billing-address') }}
</div>
<div>
{{ $order->billing_address->name }}
</div>
<div>
{{ $order->billing_address->address1 }}, {{ $order->billing_address->state }}
</div>
<div>
{{ country()->name($order->billing_address->country) }} {{ $order->billing_address->postcode }}
</div>
<div>---</div>
<div style="margin-bottom: 40px;">
{{ __('shop::app.mail.order.contact') }} : {{ $order->billing_address->phone }}
</div>
<div style="font-weight: bold;font-size: 16px; color: #242424;">
{{ __('shop::app.mail.order.payment') }}
</div>
<div style="font-size: 16px; color: #242424;">
{{ core()->getConfigData('sales.paymentmethods.' . $order->payment->method . '.title') }}
</div>
</div>
</div>
<div class="section-content">
<div class="table mb-20">
<table style="overflow-x: auto; border-collapse: collapse;
border-spacing: 0;width: 100%">
<thead>
<tr style="background-color: #f2f2f2">
<th style="text-align: left;padding: 8px">{{ __('shop::app.customer.account.order.view.SKU') }}</th>
<th style="text-align: left;padding: 8px">{{ __('shop::app.customer.account.order.view.product-name') }}</th>
<th style="text-align: left;padding: 8px">{{ __('shop::app.customer.account.order.view.price') }}</th>
<th style="text-align: left;padding: 8px">{{ __('shop::app.customer.account.order.view.qty') }}</th>
</tr>
</thead>
<tbody>
@foreach ($shipment->items as $item)
<tr>
<td data-value="{{ __('shop::app.customer.account.order.view.SKU') }}" style="text-align: left;padding: 8px">{{ $item->child ? $item->child->sku : $item->sku }}</td>
<td data-value="{{ __('shop::app.customer.account.order.view.product-name') }}" style="text-align: left;padding: 8px">{{ $item->name }}</td>
<td data-value="{{ __('shop::app.customer.account.order.view.price') }}" style="text-align: left;padding: 8px">{{ core()->formatPrice($item->price, $order->order_currency_code) }}</td>
<td data-value="{{ __('shop::app.customer.account.order.view.qty') }}" style="text-align: left;padding: 8px">{{ $item->qty }}</td>
</tr>
@if ($html = $item->getOptionDetailHtml())
<div style="">
<label style="margin-top: 10px; font-size: 16px;color: #5E5E5E; display: block;">
{{ $html }}
</label>
</div>
@endif
@endforeach
</tbody>
</table>
</div>
</div>
{{-- <div style="margin-top: 20px;font-size: 16px;color: #5E5E5E;line-height: 24px;display: inline-block;width: 100%">
<p style="font-size: 16px;color: #5E5E5E;line-height: 24px;">
{!!
__('shop::app.mail.order.help', [
'support_email' => '<a style="color:#0041FF" href="mailto:' . config('mail.from.address') . '">' . config('mail.from.address'). '</a>'
])
!!}
</p>
</div> --}}
</div>
@endcomponent

View File

@ -19,7 +19,7 @@
{!! __('shop::app.mail.order.greeting', [ {!! __('shop::app.mail.order.greeting', [
'order_id' => '<a href="' . route('customer.orders.view', $order->id) . '" style="color: #0041FF; font-weight: bold;">#' . $order->id . '</a>', 'order_id' => '<a href="' . route('customer.orders.view', $order->id) . '" style="color: #0041FF; font-weight: bold;">#' . $order->id . '</a>',
'created_at' => $order->created_at 'created_at' => $order->created_at
]) ])
!!} !!}
</p> </p>
</div> </div>
@ -49,7 +49,7 @@
<div>---</div> <div>---</div>
<div style="margin-bottom: 40px;"> <div style="margin-bottom: 40px;">
{{ __('shop::app.mail.order.contact') }} : {{ $order->shipping_address->phone }} {{ __('shop::app.mail.order.contact') }} : {{ $order->shipping_address->phone }}
</div> </div>
<div style="font-size: 16px;color: #242424;"> <div style="font-size: 16px;color: #242424;">
@ -81,7 +81,7 @@
<div>---</div> <div>---</div>
<div style="margin-bottom: 40px;"> <div style="margin-bottom: 40px;">
{{ __('shop::app.mail.order.contact') }} : {{ $order->billing_address->phone }} {{ __('shop::app.mail.order.contact') }} : {{ $order->billing_address->phone }}
</div> </div>
<div style="font-size: 16px; color: #242424;"> <div style="font-size: 16px; color: #242424;">
@ -117,7 +117,7 @@
{{ $item->qty_ordered }} {{ $item->qty_ordered }}
</span> </span>
</div> </div>
@if ($html = $item->getOptionDetailHtml()) @if ($html = $item->getOptionDetailHtml())
<div style=""> <div style="">
<label style="margin-top: 10px; font-size: 16px;color: #5E5E5E; display: block;"> <label style="margin-top: 10px; font-size: 16px;color: #5E5E5E; display: block;">
@ -164,10 +164,10 @@
</p> </p>
<p style="font-size: 16px;color: #5E5E5E;line-height: 24px;"> <p style="font-size: 16px;color: #5E5E5E;line-height: 24px;">
{!! {!!
__('shop::app.mail.order.help', [ __('shop::app.mail.order.help', [
'support_email' => '<a style="color:#0041FF" href="mailto:' . config('mail.from.address') . '">' . config('mail.from.address'). '</a>' 'support_email' => '<a style="color:#0041FF" href="mailto:' . config('mail.from.address') . '">' . config('mail.from.address'). '</a>'
]) ])
!!} !!}
</p> </p>

View File

@ -21,7 +21,7 @@
{!! __('shop::app.mail.order.greeting', [ {!! __('shop::app.mail.order.greeting', [
'order_id' => '<a href="' . route('customer.orders.view', $order->id) . '" style="color: #0041FF; font-weight: bold;">#' . $order->id . '</a>', 'order_id' => '<a href="' . route('customer.orders.view', $order->id) . '" style="color: #0041FF; font-weight: bold;">#' . $order->id . '</a>',
'created_at' => $order->created_at 'created_at' => $order->created_at
]) ])
!!} !!}
</p> </p>
</div> </div>
@ -51,10 +51,10 @@
<div>---</div> <div>---</div>
<div style="margin-bottom: 40px;"> <div style="margin-bottom: 40px;">
{{ __('shop::app.mail.order.contact') }} : {{ $order->shipping_address->phone }} {{ __('shop::app.mail.order.contact') }} : {{ $order->shipping_address->phone }}
</div> </div>
<div style="font-size: 16px;color: #242424;"> <div style="font-weight: bold;font-size: 16px;color: #242424;">
{{ __('shop::app.mail.order.shipping') }} {{ __('shop::app.mail.order.shipping') }}
</div> </div>
@ -93,10 +93,10 @@
<div>---</div> <div>---</div>
<div style="margin-bottom: 40px;"> <div style="margin-bottom: 40px;">
{{ __('shop::app.mail.order.contact') }} : {{ $order->billing_address->phone }} {{ __('shop::app.mail.order.contact') }} : {{ $order->billing_address->phone }}
</div> </div>
<div style="font-size: 16px; color: #242424;"> <div style="font-weight: bold;font-size: 16px; color: #242424;">
{{ __('shop::app.mail.order.payment') }} {{ __('shop::app.mail.order.payment') }}
</div> </div>
@ -106,46 +106,48 @@
</div> </div>
</div> </div>
@foreach ($shipment->items as $item) <div class="section-content">
<div style="background: #FFFFFF;border: 1px solid #E8E8E8;border-radius: 3px;padding: 20px;margin-bottom: 10px"> <div class="table mb-20">
<p style="font-size: 18px;color: #242424;line-height: 24px;margin-top: 0;margin-bottom: 10px;font-weight: bold;"> <table style="overflow-x: auto; border-collapse: collapse;
{{ $item->name }} border-spacing: 0;width: 100%">
</p> <thead>
<tr style="background-color: #f2f2f2">
<th style="text-align: left;padding: 8px">{{ __('shop::app.customer.account.order.view.SKU') }}</th>
<th style="text-align: left;padding: 8px">{{ __('shop::app.customer.account.order.view.product-name') }}</th>
<th style="text-align: left;padding: 8px">{{ __('shop::app.customer.account.order.view.price') }}</th>
<th style="text-align: left;padding: 8px">{{ __('shop::app.customer.account.order.view.qty') }}</th>
</tr>
</thead>
<div style="margin-bottom: 10px;"> <tbody>
<label style="font-size: 16px;color: #5E5E5E;"> @foreach ($shipment->items as $item)
{{ __('shop::app.mail.order.price') }} <tr>
</label> <td data-value="{{ __('shop::app.customer.account.order.view.SKU') }}" style="text-align: left;padding: 8px">{{ $item->child ? $item->child->sku : $item->sku }}</td>
<span style="font-size: 18px;color: #242424;margin-left: 40px;font-weight: bold;"> <td data-value="{{ __('shop::app.customer.account.order.view.product-name') }}" style="text-align: left;padding: 8px">{{ $item->name }}</td>
{{ core()->formatPrice($item->price, $order->order_currency_code) }} <td data-value="{{ __('shop::app.customer.account.order.view.price') }}" style="text-align: left;padding: 8px">{{ core()->formatPrice($item->price, $order->order_currency_code) }}</td>
</span> <td data-value="{{ __('shop::app.customer.account.order.view.qty') }}" style="text-align: left;padding: 8px">{{ $item->qty }}</td>
</div>
<div style="margin-bottom: 10px;"> @if ($html = $item->getOptionDetailHtml())
<label style="font-size: 16px;color: #5E5E5E;"> <div style="">
{{ __('shop::app.mail.order.quantity') }} <label style="margin-top: 10px; font-size: 16px;color: #5E5E5E; display: block;">
</label> {{ $html }}
<span style="font-size: 18px;color: #242424;margin-left: 40px;font-weight: bold;"> </label>
{{ $item->qty }} </div>
</span> @endif
</div> </tr>
@if ($html = $item->getOptionDetailHtml()) @endforeach
<div style=""> </tbody>
<label style="margin-top: 10px; font-size: 16px;color: #5E5E5E; display: block;"> </table>
{{ $html }}
</label>
</div>
@endif
</div> </div>
@endforeach </div>
<div style="margin-top: 20px;font-size: 16px;color: #5E5E5E;line-height: 24px;display: inline-block;width: 100%"> <div style="margin-top: 20px;font-size: 16px;color: #5E5E5E;line-height: 24px;display: inline-block;width: 100%">
<p style="font-size: 16px;color: #5E5E5E;line-height: 24px;"> <p style="font-size: 16px;color: #5E5E5E;line-height: 24px;">
{!! {!!
__('shop::app.mail.order.help', [ __('shop::app.mail.order.help', [
'support_email' => '<a style="color:#0041FF" href="mailto:' . config('mail.from.address') . '">' . config('mail.from.address'). '</a>' 'support_email' => '<a style="color:#0041FF" href="mailto:' . config('mail.from.address') . '">' . config('mail.from.address'). '</a>'
]) ])
!!} !!}
</p> </p>