PluginProbe
FluentCart A New Era of eCommerce – Faster, Lighter, and Simpler / 1.7.1
FluentCart A New Era of eCommerce – Faster, Lighter, and Simpler v1.7.1
1.7.1 1.7.0 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 All 51 releases
← All changes | app/Hooks/Handlers/ShortCodes/ShopAppHandler.php +22 -7 1.6.1 → 1.7.1 View file →
@@ -10,11 +10,11 @@
10 10 use FluentCart\App\Helpers\Helper;
11 11 //use FluentCart\App\Hooks\Handlers\ShortCodes\Buttons\AddToCartShortcode;
12 12 use FluentCart\App\Models\ProductDetail;
13 13 use FluentCart\App\Modules\Templating\AssetLoader;
14 +use FluentCart\App\Services\Renderer\RenderContext;
14 15 use FluentCart\App\Services\Renderer\ShopAppRenderer;
15 16 use FluentCart\App\Services\TemplateService;
16 -use FluentCart\App\Vite;
17 17 use FluentCart\Framework\Support\Arr;
18 18 use FluentCart\Framework\Support\Str;
19 19
20 20 class ShopAppHandler
@@ -44,9 +44,17 @@
44 44 $this->enqueueStyles();
45 45 }
46 46 }, 5);
47 47 add_shortcode(static::SHORT_CODE, function ($shortcodeAttributes, $content, $block) {
48 - return $this->handelShortcodeCall($shortcodeAttributes);
48 + // The shop shortcode registers its own closure rather than going
49 + // through ShortCode::register(), so it declares itself separately.
50 + return RenderContext::declaring(
51 + RenderContext::SOURCE_SHORTCODE,
52 + static::SHORT_CODE,
53 + function () use ($shortcodeAttributes) {
54 + return $this->handelShortcodeCall($shortcodeAttributes);
55 + }
56 + );
49 57 });
50 58 }
51 59
52 60 public function handelShortcodeCall($shortcodeAttributes)
@@ -104,8 +112,9 @@
104 112 'ids' => '',
105 113 'exclude_ids' => '',
106 114 'category' => '',
107 115 'category_id' => '',
116 + 'taxonomies' => '',
108 117 'fulfillment_type' => '',
109 118 'product_type' => '',
110 119 'on_sale' => '',
111 120 'sort_by' => '',
@@ -236,9 +245,9 @@
236 245
237 246 $allProducts = $this->getInitialProducts();
238 247 $this->defaultViewData = [
239 248 'products' => Arr::get($allProducts, 'products', []),
240 - 'placeholder_image' => Vite::getAssetUrl('images/placeholder.svg'),
249 + 'placeholder_image' => Helper::getProductPlaceholderUrl(),
241 250 'paginator' => $this->shortcodeAttributes['paginator'],
242 251 'view_mode' => $this->shortcodeAttributes['view_mode'],
243 252 'price_format' => $this->shortcodeAttributes['price_format'],
244 253 'per_page' => $this->shortcodeAttributes['per_page'],
@@ -355,12 +364,18 @@
355 364 $existing = Arr::get($mergedTerms, 'product-categories', []);
356 365 $mergedTerms['product-categories'] = array_unique(array_merge($existing, $categoryTermIds));
357 366 }
358 367
359 - // The former tag= / tag_id= attributes filtered on the product-tags
360 - // taxonomy, which FluentCart does not register (won't-ship decision
361 - // 2026-08-06). They never matched anything — worse, tag_id= filtered
362 - // every product out. Unknown attributes are now simply ignored.
368 + // --- Shortcode attribute: taxonomies="product-tags:1,2|product-brands:67" ---
369 + // Any taxonomy registered on products, including store-registered ones.
370 + foreach (Taxonomy::parseShortcodeTaxonomies($this->shortcodeAttributes['taxonomies']) as $taxonomy => $termIds) {
371 + // A segment that resolved to nothing (unknown taxonomy, foreign or
372 + // missing term) must match nothing — dropping it would widen the
373 + // list to products the shortcode never asked for.
374 + $termIds = $termIds ?: [0];
375 + $existing = Arr::get($mergedTerms, $taxonomy, []);
376 + $mergedTerms[$taxonomy] = array_values(array_unique(array_merge($existing, $termIds)));
377 + }
363 378
364 379 // --- Shortcode attribute: sort_by ---
365 380 if (!empty($this->shortcodeAttributes['sort_by'])) {
366 381 $filters['sort_by'] = sanitize_text_field($this->shortcodeAttributes['sort_by']);