wyyl/themes/default/shared/product.blade.php

105 lines
4.6 KiB
PHP

<div class="product-wrap {{ request('style_list') ?? '' }}">
<div class="image">
<a href="{{ $product['url'] }}">
<div class="image-old">
<img
data-sizes="auto"
data-src="{{ $product['images'][0] ?? image_resize('', 400, 400) }}"
src="{{ image_resize('', 400, 400) }}"
class="img-fluid lazyload">
</div>
</a>
@if (!request('style_list') || request('style_list') == 'grid')
<div class="button-wrap">
<button
class="btn btn-dark text-light btn-quick-view mx-1 rounded-3"
product-id="{{ $product['sku_id'] }}"
product-price="{{ $product['price'] }}"
data-bs-toggle="tooltip"
data-bs-placement="top"
title="{{ __('common.quick_view') }}"
onclick="bk.productQuickView({{ $product['id'] }})">
<i class="bi bi-eye"></i>
</button>
<button
class="btn btn-dark text-light btn-wishlist mx-1 rounded-3"
product-id="{{ $product['sku_id'] }}"
product-price="{{ $product['price'] }}"
data-bs-toggle="tooltip"
data-bs-placement="top"
title="{{ __('shop/products.add_to_favorites') }}"
data-in-wishlist="{{ $product['in_wishlist'] }}"
onclick="bk.addWishlist('{{ $product['id'] }}', this)">
<i class="bi bi-heart{{ $product['in_wishlist'] ? '-fill' : '' }}"></i>
</button>
<button
class="btn btn-dark text-light btn-add-cart mx-1 rounded-3"
product-id="{{ $product['sku_id'] }}"
product-price="{{ $product['price'] }}"
data-bs-toggle="tooltip"
data-bs-placement="top"
title="{{ __('shop/products.add_to_cart') }}"
@if ($product['price_setting'] === 'num')
onclick="bk.addCart({sku_id: '{{ $product['sku_id'] }}',quantity: {{$product['numprices'] != [] ? $product['numprices'][0]['num'] : 1}} }, this)">
@else
onclick="bk.addCart({sku_id: '{{ $product['sku_id'] }}'}, this)">
@endif
<i class="bi bi-cart"></i>
</button>
</div>
@endif
</div>
<div class="product-bottom-info">
@hook('product_list.item.name.before')
<div class="product-name">{{ $product['name_format'] }}</div>
<div class="product-price">
@if ($product['price_setting'] === 'sku')
<span class="price-new" style="font-size: calc(1.265rem + 0.18vw) !important;color: #212529">{{ $product['price_format'] }}</span>
@if ($product['price'] != $product['origin_price'] && $product['origin_price'] > 0)
<span style="font-size: calc(1.265rem + 0.18vw) !important;color: #212529">-</span>
<span class="price-new" style="font-size: calc(1.265rem + 0.18vw) !important;color: #212529">{{ $product['origin_price_format'] }}</span>
@endif
@elseif($product['price_setting'] === 'num')
@if ($product['price'] != $product['origin_price'] && $product['origin_price'] > 0)
<span class="price-new" style="font-size: calc(1.265rem + 0.18vw) !important;color: #212529">{{ $product['origin_price_format'] }}</span>
@endif
<span style="font-size: calc(1.265rem + 0.18vw) !important;color: #212529">-</span>
<span class="price-new" style="font-size: calc(1.265rem + 0.18vw) !important;color: #212529">{{ $product['price_format'] }}</span>
@endif
{{--@if(!empty($product['unit_format']))
<span style="color:#aaa">/{{ $product['unit_format'] }}</span>
@endif--}}
</div>
<!--yt修改-->
@if ((int)$product['minimum_order'] > 0)
<div class="product-price" style="font-size: 18px!important;">
<span class="price-new" style="color: #212529!important;">
{{$product['minimum_order'] ?? 0}} {{ $product['unit_format'] ? explode('/',$product['unit_format'])[1] : '' }}
</span>
<span style="color:#aaa;margin-left:4px">({{__('admin/product.minimum_order')}})</span>
</div>
@endif
@if (request('style_list') == 'list')
<div class="button-wrap mt-3">
<button
class="btn btn-dark text-light"
onclick="bk.addCart({sku_id: '{{ $product['sku_id'] }}'}, this)">
<i class="bi bi-cart"></i>
{{ __('shop/products.add_to_cart') }}
</button>
</div>
<div>
<button class="btn btn-link ps-0 text-secondary" data-in-wishlist="{{ $product['in_wishlist'] }}" onclick="bk.addWishlist('{{ $product['id'] }}', this)">
<i class="bi bi-heart{{ $product['in_wishlist'] ? '-fill' : '' }} me-1"></i> {{ __('shop/products.add_to_favorites') }}
</button>
</div>
@endif
</div>
</div>