PluginProbe
FluentCart A New Era of eCommerce – Faster, Lighter, and Simpler / 1.6.5
FluentCart A New Era of eCommerce – Faster, Lighter, and Simpler v1.6.5
1.6.6 1.6.5 1.6.4 1.6.3 1.6.2 1.6.1 1.6.0 1.5.4 1.5.5 1.5.3 1.5.2 1.5.1 1.5.0 1.4.2 1.4.1 1.4.0 1.3.28 1.3.27 1.3.26 1.3.25 1.3.23 1.3.22 1.3.21 1.3.20 1.3.19 All 49 releases
← All changes | app/Modules/Templating/TemplateActions.php +20 -1 1.4.1 → 1.6.5 View file →
@@ -94,9 +94,25 @@
94 94 if (!$product || !$product->detail) {
95 95 return __('Product not found', 'fluent-cart');
96 96 }
97 97
98 + // On the product page this shortcode is the block theme's
99 + // equivalent of what filterSingleProductContent appends for
100 + // classic themes, so it answers to the same setting and filter.
101 + // Placed anywhere else it is an explicit choice and still renders.
102 + if (is_singular(FluentProducts::CPT_NAME)) {
103 + $showRelevant = (new StoreSettings())->get('show_relevant_product_in_single_page') == 'yes';
104 + $showRelevant = apply_filters(
105 + 'fluent_cart/single_product_page/show_relevant_products',
106 + $showRelevant,
107 + $productId
108 + );
98 109
110 + if (!$showRelevant) {
111 + return '';
112 + }
113 + }
114 +
99 115 $products = ShopResource::getSimilarProducts($productId, false);
100 116 if (empty($products)) {
101 117 return '';
102 118 }
@@ -195,9 +211,12 @@
195 211 ];
196 212 }
197 213
198 214 $products = $productsQuery->get();
199 - (new ShopAppRenderer($products, [
215 + (new ShopAppRenderer([
216 + 'products' => $products,
217 + 'total' => $products->total(),
218 + ], [
200 219 'default_filters' => $productsQuery->getDefaultFilters(),
201 220 'custom_filters' => [
202 221 'taxonomies' => [
203 222 $taxFilters