@php /** * Mirrors html/home-electronics.html §6 (lines 3716-4279) `section-gear-bundle`: * heading-with-CTA on top, then 2-col body — LEFT col (col-lg-7 col-xl-8) with a * swiper of paired products (2 stacked per slide using tf-list vertical), RIGHT * col (col-lg-5 col-xl-4) with a sticky `box-bundle-save` widget (progress bar, * caption, 3-product bundle list with quantity controls, subtotal, Add To Cart). * * Bundle widget content is static for the demo (matches HTML reference). Quantity * inputs are display-only — the storefront cart drives real bundle behavior. * * @var \Botble\Shortcode\Compilers\Shortcode $shortcode * @var \Illuminate\Support\Collection $products (paired in 2s for the slider) * @var \Illuminate\Support\Collection $bundleProducts (first 3 used in widget) */ use Botble\Base\Facades\BaseHelper; use Botble\Media\Facades\RvMedia; $title = trim((string) ($shortcode->title ?? '')); $subtitle = trim((string) ($shortcode->subtitle ?? '')); $viewAllUrl = trim((string) ($shortcode->view_all_url ?? '')); $viewAllText = trim((string) ($shortcode->view_all_text ?? '')) ?: __('View All Products'); $bundleCaption = trim((string) ($shortcode->bundle_caption ?? '')) ?: __('Buy 3 products and save up to 30%'); $bundleProgress = max(0, min(100, (int) ($shortcode->bundle_progress ?? 50))); $bundleButtonText = trim((string) ($shortcode->bundle_button_text ?? '')) ?: __('Add To Cart'); $bundleButtonUrl = trim((string) ($shortcode->bundle_button_url ?? '')) ?: '#'; // Pair products 2 per slide (vertical pair like the demo). $pairs = $products->chunk(2)->values(); $bundleItems = $bundleProducts->take(3); $subtotal = $bundleItems->sum(fn ($p) => (float) ($p->front_sale_price_with_taxes ?? $p->sale_price ?? $p->price ?? 0)); @endphp @if ($products->isEmpty() && $bundleItems->isEmpty()) @return @endif
@if ($title !== '' || $subtitle !== '' || $viewAllUrl !== '')
@if ($title !== '')

{!! BaseHelper::clean($title) !!}

@endif @if ($subtitle !== '')

{!! BaseHelper::clean($subtitle) !!}

@endif
@if ($viewAllUrl !== '') {!! BaseHelper::clean($viewAllText) !!} @endif
@endif
@foreach ($pairs as $pair)
@foreach ($pair as $product) @includeIf(Theme::getThemeNamespace('views.ecommerce.includes.product-item'), ['product' => $product]) @endforeach
@endforeach

{{ __('Bundle Save') }}

{{ __('Save more when you shop in bundles.') }}

{!! BaseHelper::clean($bundleCaption) !!}

    @foreach ($bundleItems as $product) @php $hasSale = ! empty($product->sale_price) && $product->sale_price < $product->price; $unitPrice = format_price($product->front_sale_price_with_taxes ?? $product->sale_price ?? $product->price); $oldPrice = $hasSale ? format_price($product->price) : null; @endphp
  • {!! RvMedia::image($product->image ?? null, $product->name, 'thumb', false, ['width' => 72, 'height' => 72, 'class' => 'w-100 h-100', 'loading' => 'lazy']) !!}
    {{ $product->name }}

    XL/Blue

    {!! $unitPrice !!} @if ($oldPrice) {!! $oldPrice !!} @endif
  • @endforeach
{{ __('Subtotal') }} {!! format_price($subtotal) !!}
{!! BaseHelper::clean($bundleButtonText) !!}