@if($products) @php $count = 0; @endphp {{-- Se estiver em categorias, ele irá montar diferente, pulando a cada 4 itens --}} @if (\Request::route()->named('front.category.slug'))
@foreach ($products as $product)
{{ $product->name }}

@if(!is_null($product->attributes->where('default', 1)->first())) @if(!is_null($product->attributes->where('default', 1)->first()->sale_price)) {{ number_format($product->attributes->where('default', 1)->first()->sale_price, 2, ',', '.') }} Promoção @else {{ number_format($product->attributes->where('default', 1)->first()->price, 2, ',', '.') }} @endif @else @if ($product->sale_price && ($product->sale_price_ini < date("Y-m-d")) && ($product->sale_price_fim >= date("Y-m-d"))) Promoção{{ config('cart.currency_symbol') }} {{ number_format($product->price, 2, ',', '.') }} {{ config('cart.currency_symbol') }} {{ number_format($product->sale_price, 2, ',', '.') }} @else {{ config('cart.currency_symbol') }} {{ number_format($product->price, 2, ',', '.') }} @endif @endif

@if(config('payees.parcels') > 0) @php $valor = 0.00; $parcela = 0; $preco_valido = (($product->sale_price_ini < date("Y-m-d")) && ($product->sale_price_fim >= date("Y-m-d"))) ? $product->sale_price ?? $product->price : $product->price; for($p = 1 ; $p <= config('payees.parcels') ; $p++) { if (round($preco_valido / $p, 2) > config('payees.parcel_min')) { $valor = round($preco_valido / $p, 2); $parcela = $p; } } @endphp em até {{ $parcela }} x de {{ config('cart.currency_symbol') }} {{ number_format($valor, 2, ',', '.') }} @endif @if(config('payees.discount') > 0) @php $valor_calculo = (($product->sale_price_ini < date("Y-m-d")) && ($product->sale_price_fim >= date("Y-m-d"))) ? $product->sale_price ?? $product->price : $product->price; $valor_desconto = round($valor_calculo * (config('payees.discount') / 100)); $valor_vista = ($valor_calculo - $valor_desconto); @endphp ou por {{ config('cart.currency_symbol') }} {{ number_format($valor_vista, 2, ',', '.') }} à vista @endif

* Disponível para Curitiba e região

@if($product->quantity > 0)
{{ csrf_field() }}
@else @endif

@endforeach
{{-- Aqui, é onde aparece na página inicial --}} @else @foreach($products as $product)
{{ $product->name }}

@if(!is_null($product->attributes->where('default', 1)->first())) @if(!is_null($product->attributes->where('default', 1)->first()->sale_price)) {{ number_format($product->attributes->where('default', 1)->first()->sale_price, 2, ',', '.') }}

Promoção!

@else {{ number_format($product->attributes->where('default', 1)->first()->price, 2, ',', '.') }} @endif @else @if ($product->sale_price && (($product->sale_price_ini < date("Y-m-d")) && ($product->sale_price_fim >= date("Y-m-d"))) ) {{ config('cart.currency_symbol') }} {{ number_format($product->price, 2, ',', '.') }} {{ config('cart.currency_symbol') }} {{ number_format($product->sale_price, 2, ',', '.') }} @else {{ config('cart.currency_symbol') }} {{ number_format($product->price, 2, ',', '.') }} @endif @endif
@if(config('payees.parcels') > 0) @php $valor = 0.00; $parcela = 0; $preco_valido = (($product->sale_price_ini < date("Y-m-d")) && ($product->sale_price_fim >= date("Y-m-d"))) ? $product->sale_price ?? $product->price : $product->price; for($p = 1 ; $p <= config('payees.parcels') ; $p++) { if (round($preco_valido / $p, 2) > config('payees.parcel_min')) { $valor = round($preco_valido / $p, 2); $parcela = $p; } } @endphp em até {{ $parcela }} x de {{ config('cart.currency_symbol') }} {{ number_format($valor, 2, ',', '.') }} @endif @if(config('payees.discount') > 0) @php $valor_calculo = (($product->sale_price_ini < date("Y-m-d")) && ($product->sale_price_fim >= date("Y-m-d"))) ? $product->sale_price ?? $product->price : $product->price; $valor_desconto = round($valor_calculo * (config('payees.discount') / 100)); $valor_vista = ($valor_calculo - $valor_desconto); @endphp ou por {{ config('cart.currency_symbol') }} {{ number_format($valor_vista, 2, ',', '.') }} à vista @endif

* Disponível para Curitiba e região

@if($product->quantity > 0)
{{ csrf_field() }}
@else @endif

@php $count++; @endphp @endforeach @endif @if($products instanceof \Illuminate\Contracts\Pagination\LengthAwarePaginator)
{{ $products->links() }}
@endif @else

Nenhum produto.

@endif