@php $tipoCliente = ''; $cliente_integracao = ''; if(config('site.cliente_diferenciado')) { $tipoCliente = $order->customer->reseller; $customer = $order->customer; $products = $order->products; $entrega = $order->entrega; $courier = $order->courier; $address = $order->address; $status = $order->orderStatus; $payment = $order->paymentMethod; $cliente_integracao = \App\ClienteIntegracao::where('emp_cli_ls', config('site.emp_cli_ls')) ->where(function($q) use ($order) { $q->where('cliente_cnpj', $order->customer->cpf_cnpj); $q->orWhere('cliente_email', $order->customer->email); }) ->where('excluido', false) ->first(); } @endphp
Meu site Ver pedidos Suporte

Olá, administrador do site {{config('app.name')}}

Um novo pedido foi solicitado!

Pedido de: {{$customer->name}} @if (config('site.cliente_diferenciado') && (isset($cliente_integracao) && $cliente_integracao !== '')) (Tabelas cadastradas: {{$cliente_integracao->cliente_tabela}}, atualizado em {{\Carbon\Carbon::createFromFormat("Y-m-d H:i:s", $cliente_integracao->dh_registro)->format("d/m/Y H:i") }}) @endif

@if ($order->entrega && ($order->entrega->address_id > 0) )

Dados para entrega:

Nome: {{ $order->entrega->entrega_para }}

Data: {{ $order->entrega->data_entrega }}

Período: {{ $order->entrega->horario_entrega }}

Mensagem: {!! $order->entrega->mensagem !!}

Assinatura: {{ $order->entrega->assinatura }}


@else @if($order->payment !== 'orcamento')

Dados para entrega:

@if($order->address)

Endereço: {{ $order->address->address_1 }}, {{ $order->address->numero }} {{ $order->address->complemento }}

Bairro: {{ $order->address->address_2 }}

CEP: {{ $order->address->zip }}

Cidade: {!! $order->address->cidade->nome_municipio !!}

UF: {{ $order->address->cidade->uf }}

@endif @if($order->shipping)

Entrega por: {{ $order->shipping->name_shipping }}

Data da entrega: {!! \Carbon\Carbon::createFromFormat('Y-m-d', $order->shipping->shipping_at)->format('d/m/Y') !!}

Valor da entrega: {{ config('cart.currency_symbol') }} {!! number_format($order->shipping->value_shipping, 2, ",", ".") !!}

@endif
@endif @endif

Pedido número: {{ $order->id }}

@php $dt = \Carbon\Carbon::createFromFormat('Y-m-d H:i:s', $order->created_at); @endphp Data da Compra: {{ $dt->format("d-m-Y H:i") }}

{{ $payment }}
@if (config('site.mostrar_referencia')) @endif @php $totalQtde = 0; @endphp @foreach($products->sortBy( 'name' ) as $product) @php $preco_valido = (isset($product->pivot->product_price)) ? $product->pivot->product_price : $product->price; $id_sku = ($product->pivot->product_attribute_sku) ?? $product->pivot->product_sku; $productAttribute = $product->attributes->where('attribute_sku', $id_sku)->first(); $nameAttribute = (isset($productAttribute->attribute_name)) ? '['.$productAttribute->attribute_name .']' : ''; $totalQtde = $totalQtde+$product->pivot->quantity; @endphp {{-- {{dd($product, $order->total_products)}} --}} @if (config('site.mostrar_referencia')) @endif @endforeach @if (config('site.mostrar_referencia')) @if (config('site.mostrar_referencia'))
CÓDIGO REFERÊNCIA NOME QTDE VALOR TOTAL
{!!($product->pivot->product_attribute_sku) ?? $product->sku!!} {!!($product->reference) ?? ''!!} {{ $product->name }} {{ $nameAttribute }} {{ $product->pivot->quantity }} {{ config('cart.currency_symbol') }} {{ number_format($preco_valido, 2, ",",".") }} {{ config('cart.currency_symbol') }} {{ number_format($preco_valido * $product->pivot->quantity, 2, ",",".") }}
@else @endif Total de itens {!! $products->count()!!}
@else @endif Total de unidades {!! $totalQtde !!}
{{-- --}}
Subtotal {{config('cart.currency_symbol')}} {{number_format($order->total_products, 2, ",",".")}}
Frete {{config('cart.currency_symbol')}} {{number_format($order->total_shipping, 2, ",",".")}}
Desconto ({{config('cart.currency_symbol')}} {{number_format($order->discounts, 2, ",",".")}})
Imposto Será calculado posteriormente, na conversão do pedido
TOTAL {{config('cart.currency_symbol')}} {{number_format($order->total, 2, ",",".")}}
TOTAL PAGO {{config('cart.currency_symbol')}} {{number_format($order->total_paid, 2, ",",".")}} ({{ $order->payment }})