ldc-cocotte/resources/views/front/sable/product.blade.php
2023-03-30 15:34:57 +02:00

177 lines
12 KiB
PHP

@extends('layouts.layout',['brParam' => $product])
@section('title', __('Produit spécifique'))
@section('description', 'Produit spécifique de la boutique.')
@section('breadcrumb', request()->route()->getName())
@section('content')
<section id="product" class="pt-6 pt-lg-0">
<article class="row row-cols-1 row-cols-lg-3 m-0 card-promotion @if (!$product->is_available) card-available-soon @endif">
<!-- PRODUCT'S IMAGE -->
<div class="p-2">
<div class="position-relative">
<p class="position-absolute top-50 start-50 translate-middle font-Barlow-bold title-small text-center text-uppercase d-none">bientôt disponible</p>
@if (isset($product->picture_large))
<img class="w-100" src="{{ asset('/images/produits/' . $product->picture_large) }}">
@elseif(isset($product->picture))
<img class="w-100" src="{{ asset('/images/produits/' . $product->picture) }}" />
@else
<img class="w-100" src="{{ asset(config('app.theme') . '/img/pl_nophoto.png') }}">
@endif
</div>
</div>
<!-- PRODUCT'S DESCRIPTION -->
<div class="d-flex flex-column-reverse flex-lg-column justify-content-between justify-content-lg-start align-items-start p-2">
<div>
<h1 class="position-fixed position-lg-relative product-title text-center text-lg-start text-dark m-0">{{ $product->name }}</h1>
{!! $product->description !!}
@if (!empty($product->foodProduct->preparation))
<p class="font-Barlow-medium">Conseil de préparation :</p>
{!! $product->foodProduct->preparation ?? '' !!}
@endif
<div class="mb-4">
<p class="font-Barlow-medium m-0">Poids moyen du produit : {{ $product->weight }} {{ $product->weight_unit }}</p>
@if ($product->weight_variable)
<p class="font-Barlow-medium m-0">Produit poids variable</p>
@endif
</div>
</div>
<div class="w-100 d-flex flex-row justify-content-between justify-content-lg-start align-items-center">
@if (isset($product->foodProduct->nutriscore))
<img class="card-action-nutriscore m-3" src="{{ asset(config('app.theme') . "/img/nutriscore/nutriscore-" . $product->foodProduct->nutriscore . ".png") }}">
@endif
</div>
<div class="card-action position-fixed position-lg-relative d-flex justify-content-between align-items-center w-100 px-4 px-lg-0">
<div class="card-price d-flex justify-content-center align-items-center">
{{-- @if ($product->promotions->count())
<span class="card-price-original position-relative">@fmt_currency($product->priceTtc)</span>
@endif --}}
<p class="m-0">
<span>@if ($product->weight_variable) Environ* @endif</span>
<span class="{{-- @if ($product->promotions->count()) card-price-new @endif --}} font-Barlow-bold h4 ms-1">@fmt_currency($product->discountedPriceTtc)</span>
<span class="text-lowercase">/{{ $product->sell_unit }}</span>
</p>
</div>
@can('addToCart', $product)
<basket-buttons :product-id='{{$product->id}}'></basket-buttons>
@endcan
</div>
@if ($product->weight_variable)
<p class="fst-italic text-muted">*Produit vendu au kilo : @fmt_currency($product->priceKgTtc)/kg</p>
@endif
</div>
<!-- PRODUCT'S DETAILS -->
<div id="list" class="p-2">
@if (!empty($product->foodProduct->ingredients))
<div class="bkg-white rounded-4">
<button class="btn btn-product title-small rounded-4 text-dark w-100 font-Barlow-medium position-relative d-flex flex-row justify-content-between align-items-center"
type="button" data-bs-toggle="collapse" data-bs-target="#ingredientsList" aria-expanded="false"
aria-controls="ingredientsList">
<div class="d-flex flex-row justify-content-center align-items-center">
<img class="icon-medium me-2" src="{{ asset(config('app.theme') . "/img/icons/icon_check.png") }}" alt="">
Liste d'ingrédients
</div>
<div class="d-flex flex-row justify-content-center align-items-center">
<img class="icon-arrow" src="{{ asset(config('app.theme') . "/img/icons/icon_arrow.png") }}" alt="">
</div>
</button>
<div id="ingredientsList" class="collapse">
<div class="m-0 p-3">
{!! $product->foodProduct->ingredients ?? '' !!}
@if (!empty($product->foodProduct->allergens))
<p class="fst-italic text-muted m-0 pt-3">Allergenes : {{ $product->foodProduct->allergens }}</p>
@endif
</div>
</div>
</div>
@endif
@if (!empty($product->foodProduct->nv_kj ))
<div class="bkg-white rounded-4 mt-3">
<button class="btn btn-product title-small rounded-4 text-dark w-100 font-Barlow-medium position-relative d-flex flex-row justify-content-between align-items-center"
type="button" data-bs-toggle="collapse" data-bs-target="#nutritionalValues" aria-expanded="false"
aria-controls="nutritionalValues">
<div class="d-flex flex-row justify-content-center align-items-center">
<img class="icon-medium me-2" src="{{ asset(config('app.theme') . "/img/icons/icon_search.png") }}" alt="">
Valeurs nutritionnelles
</div>
<div class="d-flex flex-row justify-content-center align-items-center">
<img class="icon-arrow" src="{{ asset(config('app.theme') . "/img/icons/icon_arrow.png") }}" alt="">
</div>
</button>
<div id="nutritionalValues" class="collapse">
<div class="p-3">
<table class="table table-striped p-3">
<thead>
<tr>
<th>
<!-- Laisser vide -->
</th>
<th class="text-center">Pour {{ $product->foodProduct->nv_ref_weight_g }}g</th>
</tr>
</thead>
<tbody>
<tr>
<th>Énergie</th>
<th class="text-center">
{{ $product->foodProduct->nv_kj }} Kj<br>
{{ $product->foodProduct->nv_kcal }} Kcal</th>
</tr>
<tr>
<th><span>Matières Grasses<br><span class="fw-light">dont Acides Gras Saturés</span></th>
<th class="text-center">{{ $product->foodProduct->nv_fat_g }} g<br><span class="fw-light">{{ $product->foodProduct->nv_sat_fat_g }} g</span></th>
</tr>
<tr>
<th>Glucides<br><span class="fw-light">dont sucres</span></th>
<th class="text-center">{{ $product->foodProduct->nv_carb_g }} g<br><span class="fw-light">{{ $product->foodProduct->nv_sugar_g }} g</span></th>
</tr>
<tr>
<th>Fibres alimentaires</th>
<th class="text-center">{{ $product->foodProduct->nv_fiber_g }} g</th>
</tr>
<tr>
<th>Protéines</th>
<th class="text-center">{{ $product->foodProduct->nv_protein_g }} g</th>
</tr>
<tr>
<th>Sel</th>
<th class="text-center">{{ $product->foodProduct->nv_salt_g }} g</th>
</tr>
</tbody>
</table>
<p class="fst-italic text-muted m-0">*Apports Quotidien de référence pour un adulte (8400kj/2000kcal).</p>
</div>
</div>
</div>
@endif
{{-- aucune fonctionnalité de recettes associées
<div class="bkg-white rounded-4 mt-3">
<button class="btn btn-product title-small rounded-4 text-dark w-100 font-Barlow-medium position-relative d-flex flex-row justify-content-between align-items-center"
type="button" data-bs-toggle="collapse" data-bs-target="#recipeSuggestion" aria-expanded="false"
aria-controls="recipeSuggestion">
<div class="d-flex flex-row justify-content-center align-items-center">
<img class="icon-medium me-2" src="{{ asset(config('app.theme') . "/img/icons/icon_tocque.png") }}" alt="">
Suggestion de recette
</div>
<div class="d-flex flex-row justify-content-center align-items-center">
<img class="icon-arrow" src="{{ asset(config('app.theme') . "/img/icons/icon_arrow.png") }}" alt="">
</div>
</button>
<div id="recipeSuggestion" class="collapse font-Barlow-medium">
<details class="p-3">
<summary>Voir la recette</summary>
Coucou c'est la recette ici !
</details>
</div>
</div>
--}}
{{--
en revanche il existe une fonctionnalité de produits associés
@if ($product->products->count())
@include('partials.products-related')
@endif
--}}
</div>
</article>
</section>
@endsection