'type' => 'SelectFromModel',
'optionsmodel' => 'App\Models\Product',
'multiple' => true,
- 'tab' => 'Produits associés'
+ 'attribute' => 'reference',
+ 'tab' => 'Produits associés',
]);
$this->addSpecifications();
<div class="flex mb-2v sm:block">
{{-- Product images --}}
- <product-gallery :images='@json($product->getImageURLList('images', '', [asset('images/product-details/product-placeholder.svg')]))'
- class="flex-grow"
- style="max-width: 348px">
+ <product-gallery
+ :images='@json($product->getImageURLList('images', '', [asset('images/product-details/product-placeholder.svg')]))'
+ class="flex-grow"
+ style="max-width: 348px">
</product-gallery>
{{__('Ajouter à ma sélection')}}
<template v-slot:success-message>
- @svg('tick', 'w-4 mr-3') {{ __('Produit ajouté') }}
+ @svg('tick', 'w-4 mr-3') {{ __('Produit ajouté') }}
</template>
</cart-add>
- <span class="font-display text-lg inline-block align-middle rounded-full border-grey-dark border-2 h-8 w-8 text-center ml-6">?</span>
+ <span
+ class="font-display text-lg inline-block align-middle rounded-full border-grey-dark border-2 h-8 w-8 text-center ml-6">?</span>
@endif
</text-block>
{{-- Product Grid --}}
<grid cols="auto" class="products-grid">
- @foreach($related as $rel)
- <div class="product-grid-item bg-grey-200">
- {{-- Image holder --}}
- <div class="product-img-holder">
- <div class="product-img"
- style="background-image: url({{ $rel->getEntity()->image }})"></div>
- </div>
-
- {{-- Product details --}}
- <div class="p-4">
- <h3>{{ $rel->name }}</h3>
- <div class="text-sm">
- @markdown($rel->highlights)
- </div>
- <p class="mt-4">
- <a href="{{ $nav->getHrefById('product/'.$rel->id) }}">{{ __('Voir la fiche produit') }}</a>
- </p>
- </div>
- </div>
+ @foreach($related as $id=>$rel)
+ @include('partials.product-link',['id'=>$id,'product'=>$rel])
@endforeach
</grid>
{{-- Product Grid --}}
<grid cols="auto" class="products-grid mt-6">
@foreach($products as $id=>$product)
- @php
- $product_URL = $nav->getHrefById("product/{$product->id}");
- @endphp
- <div data-product-id="{{$id}}" class="product-grid-item bg-grey-200">
- {{-- Image holder --}}
- <a href="{{ $product_URL }}">
- <div class="product-img-holder">
- <div class="product-img"
- style="background-image: url({{ $product->getEntity()->image }})"></div>
- </div>
- </a>
-
- {{-- Product details --}}
- <div class="p-4">
- <h3><a class="text-navy" href="{{ $product_URL }}">{{ $product->get('reference') }}</a>
- </h3>
- <div class="product-highlights text-sm">
- {{$product->get('name')}}
- </div>
- <p class="mt-4">
- <a href="{{ $product_URL }}">
- {{ __('Voir la fiche produit') }}
- </a>
- </p>
- </div>
- </div>
+ @include('partials.product-link',['id'=>$id,'product'=>$product]);
@endforeach
</grid>
</div>
--- /dev/null
+@php
+ $product_URL = $nav->getHrefById("product/{$product->id}");
+@endphp
+<div data-product-id="{{$id}}" class="product-grid-item bg-grey-200">
+ {{-- Image holder --}}
+ <a href="{{ $product_URL }}">
+ <div class="product-img-holder">
+ <div class="product-img"
+ style="background-image: url({{ $product->getEntity()->image }})"></div>
+ </div>
+ </a>
+
+ {{-- Product details --}}
+ <div class="p-4">
+ <h3><a class="text-navy" href="{{ $product_URL }}">{{ $product->get('reference') }}</a>
+ </h3>
+ <div class="product-highlights text-sm">
+ {{$product->get('name')}}
+ </div>
+ <p class="mt-4">
+ <a href="{{ $product_URL }}">
+ {{ __('Voir la fiche produit') }}
+ </a>
+ </p>
+ </div>
+</div>