@php $hasPromo = $product->hasPromo(); $reviews = $product->getReviewData(); $hasOption = $product->hasOption(); $u = $product->getViewUrl(); $style_attrs = $product->style_attrs ?? []; @endphp
@csrf @if ($product->options) @foreach ($product->options as $opt) @if (!in_array($opt->name, ['color', 'size'])) @php $def = null; if ($opt->values) { foreach ($opt->values as $av) { if ($av->is_default) { $def = $av->value_id; } } if (!$def) { $i = 0; foreach ($opt->values as $av) { if ($i == 0) { $def = $av->value_id; } $i++; } } } @endphp @endif @endforeach @endif
{{ $product->name }} @if (isset($use_thubnail_slide) && $use_thubnail_slide && $product->gallery && count($product->gallery)) @foreach ($product->gallery as $item) {{ $product->name }} @endforeach @endif
@if (($sizeAttr = $product->getOrderOption('size')) && $sizeAttr->values) @php $defVal = null; foreach ($sizeAttr->values as $av) { if (in_array($av->value_id, $style_attrs)) { $defVal = $av->value_id; } } @endphp
@foreach ($sizeAttr->values as $av) {{-- {{$av->text}} --}}
value_id == $defVal) || (!$defVal && ($av->is_default || (!$sizeAttr->default && $loop->index == 0))))>
@endforeach
@endif
@if (($colorAttr = $product->getTypeOrderOption('color')) && $colorAttr->values) @php $defVal = null; foreach ($colorAttr->values as $av) { if (in_array($av->value_id, $style_attrs)) { $defVal = $av->value_id; } } @endphp
@foreach ($colorAttr->values as $av)
value_id == $defVal) || (!$defVal && ($av->is_default || (!$colorAttr->default && $loop->index == 0))))>
@endforeach
@else
@endif
@php $downPercent = $product->getDownPercent(); $listPrice = $product->priceFormat('list'); $finalPrice = $style_attrs ? get_currency_format($product->checkPrice($product->style_attrs)) : $product->priceFormat('final'); @endphp
@if ($product->price_status > -1) @if ($hasPromo) {{ $listPrice }} -{{ $downPercent }}% @endif {{ $finalPrice }} @else liên hệ: {{$p}} @endif
@if ($product->price_status > -1) @if ($hasPromo) {{ $listPrice }} @endif
{{ $finalPrice }} @if ($hasPromo && $product->price_status > -1) -{{ $downPercent }}% @endif
@else
liên hệ: {{$p}}
@endif
@if ($ecommerce->allow_place_order && $product->price_status > 0 && $product->status > 0 && $product->available_in_store) @else @endif