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

@ -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) {
}

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',
'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',

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

@ -54,7 +54,7 @@
{{ __('shop::app.mail.order.contact') }} : {{ $order->shipping_address->phone }}
</div>
<div style="font-size: 16px;color: #242424;">
<div style="font-weight: bold;font-size: 16px;color: #242424;">
{{ __('shop::app.mail.order.shipping') }}
</div>
@ -96,7 +96,7 @@
{{ __('shop::app.mail.order.contact') }} : {{ $order->billing_address->phone }}
</div>
<div style="font-size: 16px; color: #242424;">
<div style="font-weight: bold;font-size: 16px; color: #242424;">
{{ __('shop::app.mail.order.payment') }}
</div>
@ -106,29 +106,26 @@
</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)
<div style="background: #FFFFFF;border: 1px solid #E8E8E8;border-radius: 3px;padding: 20px;margin-bottom: 10px">
<p style="font-size: 18px;color: #242424;line-height: 24px;margin-top: 0;margin-bottom: 10px;font-weight: bold;">
{{ $item->name }}
</p>
<div style="margin-bottom: 10px;">
<label style="font-size: 16px;color: #5E5E5E;">
{{ __('shop::app.mail.order.price') }}
</label>
<span style="font-size: 18px;color: #242424;margin-left: 40px;font-weight: bold;">
{{ core()->formatPrice($item->price, $order->order_currency_code) }}
</span>
</div>
<div style="margin-bottom: 10px;">
<label style="font-size: 16px;color: #5E5E5E;">
{{ __('shop::app.mail.order.quantity') }}
</label>
<span style="font-size: 18px;color: #242424;margin-left: 40px;font-weight: bold;">
{{ $item->qty }}
</span>
</div>
<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>
@if ($html = $item->getOptionDetailHtml())
<div style="">
@ -137,8 +134,13 @@
</label>
</div>
@endif
</div>
</tr>
@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;">