{!! Theme::breadcrumb()->render(Theme::getThemeNamespace('partials.breadcrumb-list')) !!}
@php use Botble\Base\Facades\BaseHelper; use Botble\Ecommerce\Facades\EcommerceHelper; use Botble\Ecommerce\Facades\FlashSale; use Botble\Ecommerce\Models\Product; use Botble\Theme\Facades\Theme; Theme::layout('default'); Theme::set('pageTitle', $product->name); // Tell the default breadcrumb partial to skip — we render our own // section-page-title-single (breadcrumb + prev/grid/next nav) below. Theme::set('renderingProduct', true); $flashSale = null; if (FlashSale::isEnabled()) { $flashSale = FlashSale::getFlashSaleForProduct($product); } // Per-product feature flags (theme options + product flags). Defaults are safe. $is3d = (bool) ($product->is_3d ?? false); $hasVideo = (bool) ($product->video_url ?? false); $isPreOrder = (bool) ($product->is_pre_order ?? false); $isOutOfStock = method_exists($product, 'isOutOfStock') ? $product->isOutOfStock() : false; $hasCustomerNote = (bool) ($product->customer_note_enabled ?? false); $hasVolumeDiscount = (bool) ($product->enable_volume_discount ?? false); $hasBuyXGetY = (bool) ($product->enable_buy_x_get_y ?? false); $hasBundleTogether = (bool) ($product->frequently_bought_together ?? false); // Sibling navigation — scoped to the product's primary category so prev/next // walks within "Bottoms" rather than the entire catalog. Falls back to the // shop index for the grid icon. Composite (created_at, id) ordering keeps // seeded products with shared timestamps navigable. $primaryCategory = $product->categories->first(); $siblingScope = fn ($query) => $query ->wherePublished() ->where('is_variation', 0) ->when($primaryCategory, fn ($q) => $q->whereHas( 'categories', fn ($qq) => $qq->where('ec_product_categories.id', $primaryCategory->getKey()) )); $prevProduct = Product::query() ->tap($siblingScope) ->where(fn ($q) => $q ->where('created_at', '<', $product->created_at) ->orWhere(fn ($qq) => $qq->where('created_at', $product->created_at)->where('id', '<', $product->getKey()))) ->orderByDesc('created_at')->orderByDesc('id') ->first(); $nextProduct = Product::query() ->tap($siblingScope) ->where(fn ($q) => $q ->where('created_at', '>', $product->created_at) ->orWhere(fn ($qq) => $qq->where('created_at', $product->created_at)->where('id', '>', $product->getKey()))) ->orderBy('created_at')->orderBy('id') ->first(); $shopUrl = $primaryCategory?->url ?: (Route::has('public.products') ? route('public.products') : url('/')); // Resolution: ?layout= URL override → Theme::get programmatic override → per-product // attribute → admin theme option. The single `?layout=` query overloads gallery and // description style so the seeded demo menu can showcase each variant from one stable // /product-demo route. `description-accordion` is the only value that targets the // description style; everything else maps to a gallery layout. $requestLayout = request()->query('layout'); $allowedLayouts = ['default', 'bottom-thumbnail', 'right-thumbnail', 'stacked', 'grid', 'grid-2']; $galleryLayout = (in_array($requestLayout, $allowedLayouts, true) ? $requestLayout : null) ?: Theme::get('galleryLayout') ?: ($product->gallery_layout ?? theme_option('ecommerce_gallery_layout', 'default')); $galleryLayout = in_array($galleryLayout, $allowedLayouts, true) ? $galleryLayout : 'default'; $descriptionStyle = ($requestLayout === 'description-accordion' ? 'accordion' : null) ?: Theme::get('descriptionStyle') ?: theme_option('ecommerce_product_description_style', 'tabs'); $descriptionStyle = in_array($descriptionStyle, ['tabs', 'accordion'], true) ? $descriptionStyle : 'tabs'; $hasSpecificationTab = EcommerceHelper::isProductSpecificationEnabled() && $product->specificationAttributes->where('pivot.hidden', false)->isNotEmpty(); $hasReviewTab = EcommerceHelper::isReviewEnabled(); $hasVendorTab = is_plugin_active('marketplace') && $product->store?->id; $hasFaqTab = is_plugin_active('faq') && ! empty($product->faq_items); @endphp {!! BaseHelper::clean(apply_filters('ads_render', '', 'detail_page_before')) !!}
{{ $product->name }}
@if ($product->sku){{ __('SKU') }}: {{ $product->sku }}
@endif