@php use Botble\Base\Facades\BaseHelper; use Botble\Media\Facades\RvMedia; /** * Tab product showcase — mirrors home-sport.html §5 (lines 2230-2450): * `banner-collect-v03 flat-animate-tab-2` — 2-col layout: heading + numbered tab list + * View More CTA on LEFT, tab-pane image+product overlay card on RIGHT. Each tab swaps * the image AND the overlaid product info card (price + Add to cart). * * Tabs are configured via `tab_N_*` attrs (label, image, product_id). Each tab * resolves the linked product to render its name + sale price + URL inside the * RIGHT overlay card. */ $heading = trim((string) ($shortcode->title ?? '')); $subtitle = trim((string) ($shortcode->subtitle ?? '')); $viewAllUrl = trim((string) ($shortcode->view_all_url ?? '/products')); $viewAllText = trim((string) ($shortcode->view_all_text ?? __('View More'))); // Build tabs array. Up to 4 tabs (matches demo). $tabs = []; $productIds = []; foreach ([1, 2, 3, 4] as $i) { $label = trim((string) ($shortcode->{"tab_{$i}_label"} ?? '')); $img = $shortcode->{"tab_{$i}_image"} ?? null; $pid = (int) ($shortcode->{"tab_{$i}_product_id"} ?? 0); if ($label === '' && ! $img && ! $pid) continue; $tabs[] = ['label' => $label, 'image' => $img, 'product_id' => $pid]; if ($pid) $productIds[] = $pid; } // Resolve linked products in one query $products = collect(); if (! empty($productIds) && is_plugin_active('ecommerce') && class_exists(\Botble\Ecommerce\Models\Product::class)) { $products = \Botble\Ecommerce\Models\Product::query() ->whereIn('id', $productIds) ->wherePublished() ->with(['slugable']) ->get() ->keyBy('id'); } $domId = 'tabShowcase-' . substr(md5((string) ($shortcode->id ?? uniqid())), 0, 6); @endphp
htmlAttributes() !!} class="tf-section section-tab-product-showcase flat-spacing">