@php $i=0 @endphp
@foreach($parents_categorie as $parent)
@if(isset($parent['products']))
@foreach($parent['products'] as $products)
@php $img_survol='' @endphp
@foreach($products->produit->images as $image)
@if($image->defaut==1)
@php $img=$image->image_name @endphp
@endif
@if($image->survol==1)
@php $img_survol=$image->image_name @endphp
@endif
@endforeach
@php $tab=[] @endphp
@php $price=$products->produit->prixttc;
$repture =1;
@endphp
@if($products->produit->stock>0 && $products->produit->type==1)
@php $repture =0 @endphp
@endif
@if($products->produit->type==2)
@foreach($products->produit->stocks as $stock)
@if($stock->stock>0)
@php $repture =0 @endphp
@endif
@if(count($stock->declinaisons)==1)
@php $price=$stock->prixttc @endphp
@endif
@foreach($stock->declinaisons as $declinaison)
@php $att= $declinaison->attributoption->attribut->id @endphp
@php $valeur=$declinaison->valeur; @endphp
@if($att==1)
@php $valeur= $declinaison->attributoption->couleur @endphp
@endif
@php $tab[$att][$declinaison->attribut_option_id]=$valeur; @endphp
@endforeach
@endforeach
@endif
@php $tab_taille=[] @endphp
@if(isset($tab[2]) )
@php $tab_taille=$tab[2] @endphp
@endif
@if(isset($tab[3]) )
@php $tab_taille=$tab[3] @endphp
@endif
@if(!empty($img_survol))
@endif
@endforeach
@endif
@php $i++ @endphp
@endforeach