@php Theme::set('stickyHeader', 'false'); Theme::set('topHeader', Theme::partial('header-product-page', compact('product'))); Theme::set('bottomFooter', Theme::partial('footer-product-page', compact('product'))); Theme::set('pageId', 'product-page'); Theme::set('headerMobile', Theme::partial('header-mobile-product')); @endphp
@include(EcommerceHelper::viewPath('includes.product-gallery'))

{{ $product->name }}

@if ($product->brand_id)

{{ __('Brand') }}: {{ $product->brand->name }}

@endif @if (EcommerceHelper::isReviewEnabled() && $product->reviews_count > 0) @endif
@if (! EcommerceHelper::hideProductPrice() || EcommerceHelper::isCartEnabled())

{{ format_price($product->front_sale_price_with_taxes) }} @if ($product->front_sale_price !== $product->price)  {{ format_price($product->price_with_taxes) }} @endif

@endif
@if (is_plugin_active('marketplace') && $product->store_id)

{{ __('Sold By') }}: {{ $product->store->name }}

@endif
{!! apply_filters('ecommerce_before_product_description', null, $product) !!} {!! BaseHelper::clean($product->description) !!} {!! apply_filters('ecommerce_after_product_description', null, $product) !!}
@php $flashSale = $product->latestFlashSales()->first(); $catFlashData = null; if (! $flashSale) { $catFlashData = Botble\Ecommerce\Facades\FlashSale::getFacadeRoot() ->categoryFlashSaleForProduct($product); } @endphp @if ($flashSale || $catFlashData) @php $activeFlashSale = $flashSale ?? $catFlashData['flash_sale']; $catDiscount = $catFlashData['category_discount'] ?? null; $soldQty = $flashSale ? $flashSale->pivot->sold : ($catDiscount->sold ?? 0); $totalQty = $flashSale ? $flashSale->pivot->quantity : ($catDiscount->quantity ?? 0); $progress = $totalQty > 0 ? ($soldQty / $totalQty) * 100 : 0; @endphp
{{ __("Don't Miss Out! This promotion will expires in") }}
  • {{ __('Days') }}

  • {{ __('Hours') }}

  • {{ __('Minutes') }}

  • {{ __('Seconds') }}

{{ __('Sold Items') }}
@if (Botble\Ecommerce\Facades\FlashSale::isShowSaleCountLeft() && $totalQty)

{{ $soldQty }}/{{ $totalQty }} {{ __('Sold') }}

@endif
@endif
@csrf @if ($product->variations()->count() > 0)
{!! render_product_swatches($product, [ 'selected' => $selectedAttrs, 'view' => Theme::getThemeNamespace() . '::views.ecommerce.attributes.swatches-renderer' ]) !!}
@endif {!! render_product_options($product) !!}
@if ($product->isOutOfStock()) ({{ __('Out of stock') }}) @else @if (!$productVariation) ({{ __('Not available') }}) @else @if ($productVariation->isOutOfStock()) ({{ __('Out of stock') }}) @elseif (!$productVariation->with_storehouse_management || $productVariation->quantity < 1) ({{ __('Available') }}) @elseif ($productVariation->quantity) @if ($productVariation->quantity != 1) ({{ __(':number products available', ['number' => $productVariation->quantity]) }}) @else ({{ __(':number product available', ['number' => $productVariation->quantity]) }}) @endif @endif @endif @endif
{!! apply_filters(ECOMMERCE_PRODUCT_DETAIL_EXTRA_HTML, null, $product) !!} @php $buyXGetYOffers = \Botble\Ecommerce\Models\Discount::query() ->whereIn('type_option', [ \Botble\Ecommerce\Enums\DiscountTypeOptionEnum::QUANTITY_BASED, \Botble\Ecommerce\Enums\DiscountTypeOptionEnum::BUY_X_GET_Y, \Botble\Ecommerce\Enums\DiscountTypeOptionEnum::BUY_X_GET_Y_DISCOUNT, ]) ->active() ->available() ->with(['products', 'productCollections', 'productCategories']) ->get() ->filter(function ($discount) use ($product) { $originalProduct = $product->original_product; $currentProductIds = collect([$product->id, $originalProduct->id])->filter()->map(fn ($id) => (int) $id); $discountProductIds = $discount->products ->flatMap(function ($discountProduct) { $ids = collect([(int) $discountProduct->id]); if ($discountProduct->is_variation) { $ids->push((int) $discountProduct->original_product->id); } else { $ids->push(...$discountProduct->variations()->pluck('product_id')->map(fn ($id) => (int) $id)->all()); } return $ids; }) ->filter() ->unique(); return match ($discount->target) { \Botble\Ecommerce\Enums\DiscountTargetEnum::SPECIFIC_PRODUCT, \Botble\Ecommerce\Enums\DiscountTargetEnum::PRODUCT_VARIANT => $currentProductIds->intersect($discountProductIds)->isNotEmpty(), \Botble\Ecommerce\Enums\DiscountTargetEnum::PRODUCT_COLLECTIONS => $originalProduct->productCollections->pluck('id')->intersect($discount->productCollections->pluck('id'))->isNotEmpty(), \Botble\Ecommerce\Enums\DiscountTargetEnum::PRODUCT_CATEGORIES => $originalProduct->categories->pluck('id')->intersect($discount->productCategories->pluck('id'))->isNotEmpty(), default => true, }; }) ->map(function ($discount) { if ($discount->type_option === \Botble\Ecommerce\Enums\DiscountTypeOptionEnum::QUANTITY_BASED) { return [ 'buy' => (int) $discount->product_quantity, 'products' => null, 'type_option' => $discount->type_option, 'discount_percent' => min(max((float) $discount->value, 0), 100), 'title' => $discount->title, ]; } $freeProducts = collect(\Illuminate\Support\Arr::wrap(data_get($discount->apply_conditions, 'free_products', []))) ->mapWithKeys(fn ($item) => [(int) data_get($item, 'product_id') => [ 'quantity' => max((int) data_get($item, 'quantity', 1), 1), 'discount_percent' => min(max((int) data_get($item, 'discount_percent', 100), 1), 100), ]]) ->filter(fn ($quantity, $productId) => $productId > 0); $legacyProductIds = array_values(array_filter(array_map('intval', \Illuminate\Support\Arr::wrap(data_get($discount->apply_conditions, 'free_product_ids', []))))); foreach ($legacyProductIds as $legacyProductId) { $freeProducts[$legacyProductId] ??= [ 'quantity' => max((int) $discount->value, 1), 'discount_percent' => $discount->type_option === \Botble\Ecommerce\Enums\DiscountTypeOptionEnum::BUY_X_GET_Y_DISCOUNT ? min(max((int) $discount->value, 1), 100) : 100, ]; } $offerProducts = $freeProducts->isNotEmpty() ? \Botble\Ecommerce\Models\Product::query() ->whereIn('id', $freeProducts->keys()->all()) ->get() ->keyBy('id') ->all() : []; $freeProductText = $freeProducts ->map(function ($settings, $productId) use ($discount, $offerProducts) { $offerProduct = $offerProducts[$productId] ?? null; $productLabel = $offerProduct ? '' . e($offerProduct->name) . '' : e(__('selected product')); return $discount->type_option === \Botble\Ecommerce\Enums\DiscountTypeOptionEnum::BUY_X_GET_Y_DISCOUNT ? ((int) $settings['discount_percent']) . '% off ' . $productLabel : ((int) $settings['quantity']) . ' x ' . $productLabel; }) ->implode(', '); return [ 'buy' => (int) $discount->product_quantity, 'products' => $freeProductText, 'type_option' => $discount->type_option, 'discount_percent' => null, 'title' => $discount->title, ]; }) ->filter(fn ($offer) => $offer['buy'] > 0 && ($offer['products'] || $offer['type_option'] === \Botble\Ecommerce\Enums\DiscountTypeOptionEnum::QUANTITY_BASED)); @endphp @if ($buyXGetYOffers->isNotEmpty())
@foreach ($buyXGetYOffers as $offer)
{{ __('Offer') }}: @if ($offer['type_option'] === \Botble\Ecommerce\Enums\DiscountTypeOptionEnum::QUANTITY_BASED) {!! __('Buy :buy or more, get :discount% off', [ 'buy' => $offer['buy'], 'discount' => $offer['discount_percent'], ]) !!} @elseif ($offer['type_option'] === \Botble\Ecommerce\Enums\DiscountTypeOptionEnum::BUY_X_GET_Y_DISCOUNT) {!! __('Buy :buy, get :products when added together', [ 'buy' => $offer['buy'], 'products' => $offer['products'], ]) !!} @else {!! __('Buy :buy, get :products free', [ 'buy' => $offer['buy'], 'products' => $offer['products'], ]) !!} @endif
@endforeach
@endif
{{ __('Quantity') }}
@if (EcommerceHelper::isCartEnabled()) {{-- @if (EcommerceHelper::isQuickBuyButtonEnabled()) @endif --}} @if (!empty($product->store->whatsapp_number)) Connect with Merchant @endif @verbatim @endverbatim @endif
@if (EcommerceHelper::isWishlistEnabled()) @endif @if (EcommerceHelper::isCompareEnabled()) @endif

sku) style="display: none" @endif>{{ __('SKU') }}: {{ $product->sku }}

@if ($product->categories->isNotEmpty())

{{ __('Categories') }}: @foreach($product->categories as $category) {!! BaseHelper::clean($category->name) !!}@if (!$loop->last),@endif @endforeach

@endif @if ($product->tags->isNotEmpty())

{{ __('Tags') }}: @foreach($product->tags as $tag) {{ $tag->name }}@if (!$loop->last),@endif @endforeach

@endif
{!! BaseHelper::clean($product->content) !!}

{!! apply_filters(BASE_FILTER_PUBLIC_COMMENT_AREA, null, $product) !!}
@if (EcommerceHelper::isProductSpecificationEnabled() && $product->specificationAttributes->where('pivot.hidden', false)->isNotEmpty())
@include(EcommerceHelper::viewPath('includes.product-specification'))
@endif @if (EcommerceHelper::isReviewEnabled())
@include('plugins/ecommerce::themes.includes.reviews', ['reviewButtonClass' => 'ps-btn'])
@endif @if (is_plugin_active('marketplace') && $product->store_id)

{{ $product->store->name }}

{!! BaseHelper::clean($product->store->content) !!}
{{ __('More Products from :store', ['store' => $product->store->name]) }}
@endif @if (is_plugin_active('faq') && count($product->faq_items) > 0)
@foreach($product->faq_items as $faq)

{!! BaseHelper::clean($faq[1]['value']) !!}
@endforeach
@endif
@if (is_plugin_active('ads')) @endif
@php $crossSellProducts = get_cross_sale_products($product, 7); @endphp @if (count($crossSellProducts) > 0) {!! Theme::partial('cross-sell-products', compact('crossSellProducts')) !!} @endif @php $relatedProducts = get_related_products($product, 12); if ($relatedProducts->isEmpty()) { $relatedProducts = get_featured_products([ 'take' => 12, 'condition' => [ ['ec_products.id', '!=', $product->getKey()], 'ec_products.is_featured' => 1, 'ec_products.is_variation' => 0, ], ]); } if ($relatedProducts->isEmpty()) { $relatedProducts = get_products([ 'take' => 12, 'condition' => [ ['ec_products.id', '!=', $product->getKey()], 'ec_products.is_variation' => 0, ], ]); } @endphp @if ($relatedProducts->isNotEmpty()) @endif