@php /** * @name Sidebar quickcart\Quickcart\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 ) @if($variation->in_cart()) @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
@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 = ['quickcart-product-attribute', 'quickcart-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 if($only_incart){ if(!$term->in_cart()){ continue; } } if($only_instock){ if(!$term->in_stock() && !$term->in_cart()){ continue; } } $term_type = 'text'; $class_term = ['quickcart-product-term', 'quickcart-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[] = 'quickcart-product-term-' . $term_type; }else{ $class_term[] = 'quickcart-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
@if($term->in_cart()) {!! $term->get_quantity() !!} @else 0 @endif
@endforeach
{!! $variation->get_quantity() !!}
x {!! $product->get_price_html() !!}
{!! $variation->get_amount_html(true) !!}
@endif @endforeach