← All changes
|
app/Hooks/Handlers/BlockEditors/BuySectionBlockEditor.php
+7
-2
1.3.21
→
1.7.0
View file →
| @@ -4,9 +4,8 @@ | ||
| 4 | 4 | |
| 5 | 5 | use FluentCart\App\Modules\Templating\AssetLoader; |
| 6 | 6 | use FluentCart\App\Services\Renderer\ProductRenderer; |
| 7 | 7 | use FluentCart\App\Services\Translations\TransStrings; |
| 8 | -use FluentCart\App\Vite; | |
| 9 | 8 | use FluentCart\Framework\Support\Arr; |
| 10 | 9 | use FluentCart\App\Models\Product; |
| 11 | 10 | use FluentCart\App\Helpers\Helper; |
| 12 | 11 | use FluentCart\App\App; |
| @@ -40,9 +39,9 @@ | ||
| 40 | 39 | 'slug' => $this->slugPrefix, |
| 41 | 40 | 'name' => static::getEditorName(), |
| 42 | 41 | 'title' => __('Buy Section', 'fluent-cart'), |
| 43 | 42 | 'description' => __('This block will display the buy section.', 'fluent-cart'), |
| 44 | - 'placeholder_image' => Vite::getAssetUrl('images/placeholder.svg'), | |
| 43 | + 'placeholder_image' => Helper::getProductPlaceholderUrl(), | |
| 45 | 44 | ], |
| 46 | 45 | 'fluent_cart_block_translation' => TransStrings::blockStrings(), |
| 47 | 46 | ]; |
| 48 | 47 | } |
| @@ -67,8 +66,14 @@ | ||
| 67 | 66 | |
| 68 | 67 | if (!$product) { |
| 69 | 68 | return ''; |
| 70 | 69 | } |
| 70 | + | |
| 71 | + // The Buy Section renders the single-product purchase UI, including | |
| 72 | + // Pro's advanced-variation selector — fire the asset hook so Pro | |
| 73 | + // enqueues the selector CSS/JS (without it the selector is unstyled and | |
| 74 | + // its price/variant JS never wires up). Pro dedupes by enqueue handle. | |
| 75 | + do_action('fluent_cart/advanced_variation/enqueue_assets'); | |
| 71 | 76 | |
| 72 | 77 | ob_start(); |
| 73 | 78 | (new ProductRenderer($product))->renderBuySection(); |
| 74 | 79 | return ob_get_clean(); |