@php /** * @name Pagina lista carrelli\Carrello\Prodotto\Prodotto con varianti\Prodotto con due variazioni * @version 1.0.0 */ @endphp @php $only_incart = call_setting('settings.cart.quickcart_only_incart'); $only_instock = false; if (!is_agent()) { $only_instock = call_setting('settings.product.only_instock'); } @endphp @foreach ($variations as $variation) @php $main_attribute = $variation->get_attributes(); $main_term = $main_attribute->get_term(); $main_type = $main_attribute->get_type(); $attribute = $variation->get_attributes()->get_subterms(); $type = $attribute->get_type(); $terms = $attribute->get_terms(); if ($only_incart) { if (!$main_term->in_cart()) { continue; } } if ($only_instock) { if (!$main_term->in_stock() && !$main_term->in_cart()) { continue; } } @endphp @if ($variation->get_quantity() > 0)
@php $main_term_type = 'text'; $nocolor = false; if ($main_type == 'color') { $main_term_type = 'color'; $color = $variation->get_color(); if (!empty($color)) { $main_term_type = $color->get_type(); $color = $color->get_color(); } else { $nocolor = true; $color = ''; } } $class_main_term = ['cart-list-product-attribute', 'cart-list-product-attribute-type-' . $main_type, 'attr-' . $main_term_type, 'attr-' . $main_term->get_slug()]; if ($nocolor) { $class_main_term[] = 'attr-color-not-found'; } @endphp
@if ($main_term_type == 'text') {{ $main_term->get_name() }} @endif @if ($main_term_type == 'hex')
@endif @if ($main_term_type == 'image')
@endif
{{--
--}}
@foreach ($terms as $term) @php $term_type = 'text'; $class_term = ['cart-list-product-term', 'cart-list-product-term-' . $term->get_slug()]; $nocolor = false; if ($type == 'color') { $term_type = 'color'; $color = $term->get_color(); if (!empty($color)) { $term_type = $color->get_type(); $color = $color->get_color(); } else { $nocolor = true; $color = ''; } $class_term[] = 'cart-list-product-term-' . $term_type; } else { $class_term[] = 'cart-list-product-term-text'; } if ($nocolor) { $class_term[] = 'attr-color-not-found'; } @endphp
@if ($type == 'color') @if ($term_type == 'hex')
@endif @if ($term_type == 'image')
@endif @else
{{ $term->get_name() }}
@endif
{!! $term->get_quantity() !!}
@endforeach
{!! $variation->get_quantity() !!}
x {!! $product->get_price_html() !!}
{!! $variation->get_amount_html(true) !!}
@endif @endforeach