@php use Botble\Base\Facades\BaseHelper; use Botble\Media\Facades\RvMedia; /** * Testimonials style-v2-product. * * Default render is the existing `testimonial-v01 style-2` card (used by other variants). * Two opt-in extensions: * - card_type='type-3' — 4-up small-avatar list (existing, used by home-fashion). * - card_type='type-2' — home-baby.html §8 layout (lines 5324-5531): * `testimonial-v01 style-2 type-2` 4-up swiper — * avatar (60x60) → star → author h6 + Verified Buyer * → quote → product mini-card. Like type-3 but inside * a centered `.container` and with an `
` author tag. * - card_type='style-8' — home-sport.html §9 layout (lines 2714-2870): * `testimonial-v01 style-8 style-def` w/ LEFT image * (234x330) + RIGHT content (star → author h6 → quote * → product mini-card). Renders inside a cream * `bg-main flat-spacing` outer when bg_main='yes'. */ $autoplay = ($shortcode->autoplay ?? 'yes') === 'yes'; $cardType = trim((string) ($shortcode->card_type ?? '')); $isType3 = $cardType === 'type-3'; $isType2 = $cardType === 'type-2'; $isStyle8 = $cardType === 'style-8'; // - card_type='style-1-cosmetic' — html/home-cosmetic.html §8 (lines 2356-2415): // `testimonial-v01 style-1 type-3 style-def` 2-up swiper — // LEFT image (285x380) + RIGHT content (star → h6 author // + Verified Buyer → quote → product mini-card 88x88). // Like style-8 but with the cosmetic demo's class names, // image size and wider 60px desktop gap. // - card_type='style-1-pod' — html/home-pod.html §9 (lines 3160-3320): // `testimonial-v01 style-1 type-2` 2-up swiper — LEFT // image (285x380) + RIGHT content ordered star → quote // (`flex-unset`) → author (h6 + br-line + Verified Buyer, // `mb-xl-auto`) → product mini-card 88x88. No `style-def`. // - card_type='style-1-bag' — html/home-bag-accessories.html §9 (lines 2751-2861): // `testimonial-v01 style-1 style-def` 2-up swiper — LEFT // image (285x380) + RIGHT content (star → p.author-name+h6 + // Verified Buyer → quote h6 text-capitalize → product mini-card // 88x88 with `link-underline-primary`). Like style-1-cosmetic but // without `type-3`, with `

` instead of // `

`, and quote uses h6+text-capitalize. // - card_type='style-1-decor' — html/home-decor.html §7 (lines 2135-2242): // `testimonial-v01 style-def style-4` 2-up swiper — LEFT // image (234x312) `tes-image hover-overlay` + Eye box-icon // + RIGHT content ordered star (fs-16) → plain quote → p.author-name // + verified ICON ONLY (no "Verified Buyer" label) + product mini-card // (60x60, plain `.link` w/ underline, plain `prd_price`). No style-1. // - outer_class='bare-section' wraps the swiper in a bare zero-padding section // instead of the default no-outer (style-1-* family). // Used by home-decor §7 (`
`). $isStyle1Cosmetic = $cardType === 'style-1-cosmetic'; $isStyle1Pod = $cardType === 'style-1-pod'; $isStyle1Bag = $cardType === 'style-1-bag'; $isStyle1Decor = $cardType === 'style-1-decor'; // outer_class='bare-section' renders a bare `
` + `.container` // wrap around the swiper + heading (mirrors home-decor §7 demo wrapper). $outerClass = trim((string) ($shortcode->outer_class ?? '')); $useOuter = $outerClass !== ''; // type-2 and type-3 share the 4-up small-avatar list layout. $isCompactList = $isType3 || $isType2; $useBgMain = ($shortcode->bg_main ?? 'no') === 'yes'; if ($isStyle8 || $isStyle1Cosmetic || $isStyle1Pod || $isStyle1Bag || $isStyle1Decor) { $containerClass = 'container'; $preview = 2; $tablet = 2; $mobileSm = 1; $pagination = ($isStyle1Pod || $isStyle1Bag) ? 2 : 1; $paginationSm = 2; $paginationMd = 2; $paginationLg = 2; // home-decor §7 demo: data-space-lg="30" data-space-md="20" data-space="15" $spaceLg = $isStyle1Decor ? 30 : (($isStyle1Cosmetic || $isStyle1Pod || $isStyle1Bag) ? 60 : 30); $spaceMd = $isStyle1Decor ? 20 : (($isStyle1Cosmetic || $isStyle1Pod || $isStyle1Bag) ? 30 : 20); $space = 15; } else { $containerClass = $isType3 ? 'container-full' : 'container'; $preview = $isCompactList ? 4 : 2; $tablet = $isCompactList ? 3 : 2; $mobileSm = $isCompactList ? 2 : 1; $pagination = $isCompactList ? 2 : 1; $paginationSm = $isCompactList ? 1 : 2; $paginationMd = $isCompactList ? 3 : 2; $paginationLg = $isCompactList ? 4 : 2; $spaceLg = $isCompactList ? 20 : 30; $spaceMd = 15; $space = 10; } @endphp @if ($useBgMain)
@if (! empty($shortcode->title ?? '') || ! empty($shortcode->subtitle ?? ''))
@if (! empty($shortcode->title ?? ''))

{!! BaseHelper::clean($shortcode->title) !!}

@endif @if (! empty($shortcode->subtitle ?? ''))

{!! BaseHelper::clean($shortcode->subtitle) !!}

@endif
@endif @elseif ($useOuter) {{-- outer_class wrapper opens the demo's bare `
` container. Heading is NOT rendered here — testimonials/index.blade.php already renders `sect-heading type-2 text-center` before including this partial. --}}
@endif
@foreach ($items as $index => $item) @php $rating = max(0, min(5, (int) ($item['rating'] ?? 5))); $avatar = $item['avatar'] ?? null; $name = $item['name'] ?? ''; $role = $item['role'] ?? ''; $content = $item['content'] ?? ''; $productImage = $item['product_image'] ?? null; $productName = $item['product_name'] ?? ''; $productPrice = $item['product_price'] ?? ''; $productUrl = $item['product_url'] ?? '#'; @endphp
@if ($isStyle8) {{-- home-sport.html §9 — testimonial-v01.style-8.style-def with LEFT image + RIGHT content. --}}
0) data-wow-delay="0.1s" @endif> @if (! empty($avatar))
{!! RvMedia::image($avatar, $name, null, false, ['width' => 234, 'height' => 330, 'loading' => 'lazy']) !!}
@endif
@if ($rating > 0)
@for ($i = 1; $i <= $rating; $i++) @endfor
@endif @if (! empty($name))

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

{{ ! empty($role) ? $role : __('Verified Buyer') }}
@endif @if (! empty($content))

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

@endif @if (! empty($productImage) || ! empty($productName))
@if (! empty($productImage))
{!! RvMedia::image($productImage, $productName, 'thumb', false, ['width' => 60, 'height' => 60, 'class' => 'aspect-ratio-1 object-fit-cover', 'loading' => 'lazy']) !!}
@endif
@if (! empty($productName)) {!! BaseHelper::clean($productName) !!} @endif @if (! empty($productPrice))

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

@endif
@endif
@elseif ($isStyle1Cosmetic) {{-- html/home-cosmetic.html §8 — testimonial-v01.style-1.type-3.style-def LEFT image (285x380) + RIGHT content + product mini-card (88x88). --}}
0) data-wow-delay="0.1s" @endif> @if (! empty($avatar))
{!! RvMedia::image($avatar, $name, null, false, ['width' => 285, 'height' => 380, 'loading' => 'lazy']) !!}
@endif
@if ($rating > 0)
@for ($i = 1; $i <= $rating; $i++) @endfor
@endif @if (! empty($name))
{!! BaseHelper::clean($name) !!}
{{ ! empty($role) ? $role : __('Verified Buyer') }}
@endif @if (! empty($content))

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

@endif @if (! empty($productImage) || ! empty($productName))
@if (! empty($productImage))
{!! RvMedia::image($productImage, $productName, 'thumb', false, ['width' => 88, 'height' => 88, 'class' => 'aspect-ratio-1 object-fit-cover', 'loading' => 'lazy']) !!}
@endif
@if (! empty($productName)) {!! BaseHelper::clean($productName) !!} @endif @if (! empty($productPrice))

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

@endif
@endif
@elseif ($isStyle1Bag) {{-- html/home-bag-accessories.html §9 — testimonial-v01.style-1.style-def LEFT image (285x380) + RIGHT content + product mini-card (88x88). Differs from style-1-cosmetic by NO `type-3`, p.author-name vs h6.author-name, quote uses h6+text-capitalize, product link uses `link-underline-primary`. --}}
0) data-wow-delay="0.1s" @endif> @if (! empty($avatar))
{!! RvMedia::image($avatar, $name, null, false, ['width' => 285, 'height' => 380, 'loading' => 'lazy']) !!}
@endif
@if ($rating > 0)
@for ($i = 1; $i <= $rating; $i++) @endfor
@endif @if (! empty($name))

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

{{ ! empty($role) ? $role : __('Verified Buyer') }}
@endif @if (! empty($content))

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

@endif @if (! empty($productImage) || ! empty($productName))
@if (! empty($productImage))
{!! RvMedia::image($productImage, $productName, 'thumb', false, ['width' => 88, 'height' => 88, 'class' => 'aspect-ratio-1 object-fit-cover', 'loading' => 'lazy']) !!}
@endif
@if (! empty($productName)) {!! BaseHelper::clean($productName) !!} @endif @if (! empty($productPrice))

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

@endif
@endif
@elseif ($isStyle1Decor) {{-- html/home-decor.html §7 — testimonial-v01.style-def.style-4 LEFT image (234x312) `tes-image.hover-overlay` + Eye box-icon + RIGHT content: star (fs-16) → plain quote → p.author-name + verified-icon-only (NO "Verified Buyer" label) → product mini-card (60x60 plain link, plain prd_price). --}}
0) data-wow-delay="0.1s" @endif> @if (! empty($avatar))
@if (! empty($productUrl)) {{ __('View product') }} @endif {!! RvMedia::image($avatar, $name, null, false, ['width' => 234, 'height' => 312, 'loading' => 'lazy']) !!}
@endif
@if ($rating > 0)
@for ($i = 1; $i <= $rating; $i++) @endfor
@endif @if (! empty($content))

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

@endif @if (! empty($name))

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

@endif @if (! empty($productImage) || ! empty($productName))
@if (! empty($productImage))
{!! RvMedia::image($productImage, $productName, 'thumb', false, ['width' => 60, 'height' => 60, 'class' => 'aspect-ratio-1 object-fit-cover', 'loading' => 'lazy']) !!}
@endif
@if (! empty($productName)) {!! BaseHelper::clean($productName) !!} @endif @if (! empty($productPrice))

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

@endif
@endif
@elseif ($isStyle1Pod) {{-- html/home-pod.html §9 — testimonial-v01.style-1.type-2 LEFT image (285x380) + RIGHT content ordered star → quote → author (h6 + br-line) → product mini-card. --}}
0) data-wow-delay="0.1s" @endif> @if (! empty($avatar))
{!! RvMedia::image($avatar, $name, null, false, ['width' => 285, 'height' => 380, 'loading' => 'lazy']) !!}
@endif
@if ($rating > 0)
@for ($i = 1; $i <= $rating; $i++) @endfor
@endif @if (! empty($content))

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

@endif @if (! empty($name))
{!! BaseHelper::clean($name) !!}
{{ ! empty($role) ? $role : __('Verified Buyer') }}
@endif @if (! empty($productImage) || ! empty($productName))
@if (! empty($productImage))
{!! RvMedia::image($productImage, $productName, 'thumb', false, ['width' => 88, 'height' => 88, 'class' => 'aspect-ratio-1 object-fit-cover', 'loading' => 'lazy']) !!}
@endif
@if (! empty($productName)) {!! BaseHelper::clean($productName) !!} @endif @if (! empty($productPrice))

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

@endif
@endif
@else
0) data-wow-delay="{{ number_format($index / 10, 1) }}s" @endif>
@if ($isCompactList && ! empty($avatar))
{!! RvMedia::image($avatar, $name ?: __('Avatar'), null, false, ['width' => 60, 'height' => 60, 'loading' => 'lazy']) !!}
@endif @if ($rating > 0)
@for ($i = 1; $i <= $rating; $i++) @endfor
@endif @if (! empty($name))
@if ($isType2)
{!! BaseHelper::clean($name) !!}
@elseif ($isType3)
{!! BaseHelper::clean($name) !!}
@else
{!! BaseHelper::clean($name) !!}
@endif
$isCompactList])> {{ ! empty($role) ? $role : __('Verified Buyer') }}
@endif @if (! empty($content))

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

@endif @if (! empty($productImage) || ! empty($productName))
@if (! empty($productImage))
{!! RvMedia::image($productImage, $productName, 'thumb', false, ['width' => 60, 'height' => 60, 'class' => 'aspect-ratio-1 object-fit-cover', 'loading' => 'lazy']) !!}
@endif
@if (! empty($productName)) {!! BaseHelper::clean($productName) !!} @endif @if (! empty($productPrice))

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

@endif
@endif
@endif
@endforeach
@if ($useBgMain || $useOuter)
@endif