{{-- Theme override of plugins/ecommerce::themes.includes.cross-sale-products. The plugin ships a Slick-based carousel, but Slick isn't bundled in this theme — leaving the cross-sale "Frequently Bought Together" block as a static row with overflow:hidden, no arrows, no mobile scroll. This override swaps to the theme's existing Swiper infrastructure (.tf-swiper auto-init via amerceInitSwipers) which is already loaded via assets/js/carousel.js, then re-initialises Swiper after the AJAX replaceWith() since the plugin's initSlickCarousel() can't. Keeps the plugin's class names (.ec-cross-sale-*) so the rebrand SCSS in _ecommerce-upsale-crosssale.scss continues to win specificity. --}} @php use Botble\Ecommerce\Facades\EcommerceHelper; use Botble\Media\Facades\RvMedia; @endphp @if(request()->ajax() && isset($products) && isset($parentProduct)) @if($products->isNotEmpty())

{{ __('Frequently Bought Together') }}

{{ __('Customers who viewed this item also bought') }}

@foreach ($products as $index => $product) @php $productPrice = $product->price(); $salePrice = $productPrice->getPrice(); $originalPrice = $productPrice->getPriceOriginal(); $hasDiscount = $salePrice < $originalPrice; $shouldShowPrice = (! EcommerceHelper::hideProductPrice() || EcommerceHelper::isCartEnabled()) && (! EcommerceHelper::hideProductPriceWhenZero() || $salePrice > 0); $hasVariations = $product->hasVariations; @endphp
@if($index > 0)
@endif

{{ $product->name }}

@if ($shouldShowPrice)
{{ format_price($salePrice) }} @if($hasDiscount) {{ format_price($originalPrice) }} @endif
@endif @if(EcommerceHelper::isCartEnabled()) @endif
@endforeach
{{-- Theme icomoon set has icon-CaretLeft but no icon-CaretRight (only CaretRightThin); ArrowLeft/ArrowRight are the only symmetric pair that's both available and tonally similar. --}}
{{-- A MutationObserver in assets/js/carousel.js detects the AJAX-injected .ec-cross-sale-section and calls amerceInitSwipers() on its swiper — no inline