| @@ -10,8 +10,9 @@ | ||
| 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 | 17 | use FluentCart\App\Vite; |
| 17 | 18 | use FluentCart\Framework\Support\Arr; |
| @@ -44,9 +45,17 @@ | ||
| 44 | 45 | $this->enqueueStyles(); |
| 45 | 46 | } |
| 46 | 47 | }, 5); |
| 47 | 48 | add_shortcode(static::SHORT_CODE, function ($shortcodeAttributes, $content, $block) { |
| 48 | - return $this->handelShortcodeCall($shortcodeAttributes); | |
| 49 | + // The shop shortcode registers its own closure rather than going | |
| 50 | + // through ShortCode::register(), so it declares itself separately. | |
| 51 | + return RenderContext::declaring( | |
| 52 | + RenderContext::SOURCE_SHORTCODE, | |
| 53 | + static::SHORT_CODE, | |
| 54 | + function () use ($shortcodeAttributes) { | |
| 55 | + return $this->handelShortcodeCall($shortcodeAttributes); | |
| 56 | + } | |
| 57 | + ); | |
| 49 | 58 | }); |
| 50 | 59 | } |
| 51 | 60 | |
| 52 | 61 | public function handelShortcodeCall($shortcodeAttributes) |
| @@ -104,10 +113,8 @@ | ||
| 104 | 113 | 'ids' => '', |
| 105 | 114 | 'exclude_ids' => '', |
| 106 | 115 | 'category' => '', |
| 107 | 116 | 'category_id' => '', |
| 108 | - 'tag' => '', | |
| 109 | - 'tag_id' => '', | |
| 110 | 117 | 'fulfillment_type' => '', |
| 111 | 118 | 'product_type' => '', |
| 112 | 119 | 'on_sale' => '', |
| 113 | 120 | 'sort_by' => '', |
| @@ -357,21 +364,12 @@ | ||
| 357 | 364 | $existing = Arr::get($mergedTerms, 'product-categories', []); |
| 358 | 365 | $mergedTerms['product-categories'] = array_unique(array_merge($existing, $categoryTermIds)); |
| 359 | 366 | } |
| 360 | 367 | |
| 361 | - // --- Shortcode attribute: tag (by slug) and tag_id --- | |
| 362 | - $tagTermIds = []; | |
| 363 | - if (!empty($this->shortcodeAttributes['tag'])) { | |
| 364 | - $tagTermIds = Taxonomy::getTermIdsBySlugs($this->shortcodeAttributes['tag'], 'product-tags'); | |
| 365 | - } | |
| 366 | - if (!empty($this->shortcodeAttributes['tag_id'])) { | |
| 367 | - $tIds = array_values(array_filter(array_map('intval', array_map('trim', explode(',', $this->shortcodeAttributes['tag_id']))))); | |
| 368 | - $tagTermIds = array_unique(array_merge($tagTermIds, $tIds)); | |
| 369 | - } | |
| 370 | - if (!empty($tagTermIds)) { | |
| 371 | - $existing = Arr::get($mergedTerms, 'product-tags', []); | |
| 372 | - $mergedTerms['product-tags'] = array_unique(array_merge($existing, $tagTermIds)); | |
| 373 | - } | |
| 368 | + // The former tag= / tag_id= attributes filtered on the product-tags | |
| 369 | + // taxonomy, which FluentCart does not register (won't-ship decision | |
| 370 | + // 2026-08-06). They never matched anything — worse, tag_id= filtered | |
| 371 | + // every product out. Unknown attributes are now simply ignored. | |
| 374 | 372 | |
| 375 | 373 | // --- Shortcode attribute: sort_by --- |
| 376 | 374 | if (!empty($this->shortcodeAttributes['sort_by'])) { |
| 377 | 375 | $filters['sort_by'] = sanitize_text_field($this->shortcodeAttributes['sort_by']); |