@php /** * @name Sidebar quickcart\Quickcart\Prodotto\Prodotto con varianti\Prodotto con una variazione * @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 $attribute = $variation->get_attributes(); $type = $attribute->get_type(); $term = $attribute->get_term(); if($only_instock){ if(!$term->in_stock() && !$term->in_cart()){ continue; } } @endphp
@php $term_type = 'text'; $nocolor = false; if($type == 'color'){ $term_type = 'color'; $color = $variation->get_color(); if(!empty($color)){ $term_type = $color->get_type(); $color = $color->get_color(); }else{ $nocolor = true; $color = ''; } } $class_term = ['quickcart-product-attribute', 'quickcart-product-attribute-type-' . $type, 'attr-' . $term_type, 'attr-' . $term->get_slug()]; if($nocolor){ $class_term[] = 'attr-color-not-found'; } @endphp
@if($term_type == 'text') {{ $term->get_name() }} @endif @if($term_type == 'hex')
@endif @if($term_type == 'image')
@endif
@php $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(); } $class_term[] = 'quickcart-product-term-' . $term_type; }else{ $class_term[] = 'quickcart-product-term-text'; } if($nocolor){ $class_term[] = 'attr-color-not-found'; } @endphp
@if($term->in_cart()) {!! $term->get_quantity() !!} @else 0 @endif
{!! $variation->get_quantity() !!}
x {!! $product->get_price_html() !!}
{!! $variation->get_amount_html(true) !!}
@endif @endforeach