@if (is_plugin_active('ecommerce')) @php $numberOfDisplays = (int) Arr::get($config, 'number_of_displays') ?: 6; $params = [ 'take' => $numberOfDisplays, 'with' => ['slugable', 'productCollections'], ] + EcommerceHelper::withReviewsParams(); switch (Arr::get($config, 'type')) { case 'on_sale': $products = get_products_on_sale($params); break; case 'featured': $products = get_featured_products($params); break; default: $products = get_trending_products($params); break; } @endphp @if ($products->count()) @endif @endif