@php
$order = \App\Order::with('orderDetails')->where('id', @$array['content'])->first();
$generalsetting = \App\GeneralSetting::first();
$rupees = '
₹ ';
$grandTotal = \App\OrderDetail::where('order_id', @$array['content'])->sum('price');
$checkPincode = DB::table('delivery_tat')->where('destination_pin', json_decode(@$order->shipping_address)->postal_code)->first();
foreach ($order->orderDetails as $key => $value) {
if ($value->product->managed_by == 1) {
$match = $value->product->id;
break;
}
}
if(!empty($match)) {
if(!empty(@$checkPincode)){
$add_number_of_days = $checkPincode->surface_tat;
$delivery_date = date('d-m-Y',strtotime(@$order->created_at) + (24*3600*$add_number_of_days));
}else{
$delivery_date = date('d-m-Y',strtotime(@$order->created_at) + (24*3600*7));
}
}else{
$delivery_date = date('d-m-Y',strtotime(@$order->created_at) + (24*3600*7));
}
@endphp
Hi, {{$order->user->name}}
Thank you for shopping with khadiindia. Your estimated delivery date is {{@$delivery_date}}. We'll update you with shopping details soon. To view status or make any changes, visit your My Account on ekhadiindia.com.
# |
{{ translate('Product Name') }} |
{{ translate('Sku Name') }} |
{{ translate('Quantity') }} |
{{ translate('Unit Price') }} |
{{ translate('Total Price') }} |
@foreach($order->orderDetails as $key => $orderDetail)
@if(!empty($orderDetail))
@php $unitPrice = $orderDetail->price / $orderDetail->quantity;
if(!empty($orderDetail->variation)){
$productStock = \App\ProductStock::with('product')->where('product_id', $orderDetail->product_id)->where('variant', @$orderDetail->variation)->first();
}else{
$productStock = \App\ProductStock::with('product')->where('product_id', $orderDetail->product_id)->first();
}
if(!empty($productStock)){
$sku = $productStock->sku;
}else{
$sku = "N/A";
}
@endphp
{{$key+1}} |
{{ @$orderDetail->product->name }} |
{{@$sku}} |
{{ @$orderDetail->quantity }} |
{!! $rupees.number_format((float)@$unitPrice, 2, '.', '') !!} |
{!! $rupees.number_format((float)@$orderDetail->price, 2, '.', '') !!} |
@endif
@endforeach
@if(@$order->coupon_discount > 0)
Coupon Discount |
{!! $rupees.number_format((float)@$order->coupon_discount, 2, '.', '') !!}
|
@endif