← All changes
|
app/Modules/Templating/Bricks/Elements/PriceRange.php
+14
-8
1.6.2
→
1.6.5
View file →
| @@ -3,8 +3,9 @@ | ||
| 3 | 3 | namespace FluentCart\App\Modules\Templating\Bricks\Elements; |
| 4 | 4 | |
| 5 | 5 | use Bricks\Element; |
| 6 | 6 | use FluentCart\App\Modules\Data\ProductDataSetup; |
| 7 | +use FluentCart\App\Modules\Templating\AssetLoader; | |
| 7 | 8 | use FluentCart\App\Services\Renderer\ProductRenderer; |
| 8 | 9 | use FluentCart\Framework\Support\Arr; |
| 9 | 10 | use FluentCart\App\Modules\Templating\Bricks\BricksLoader; |
| 10 | 11 | |
| @@ -16,8 +17,13 @@ | ||
| 16 | 17 | public $category = 'fluent-cart'; |
| 17 | 18 | public $name = 'fct-price-range'; |
| 18 | 19 | public $icon = 'ti-money fluent-cart-element-icon'; |
| 19 | 20 | |
| 21 | + public function enqueue_scripts() | |
| 22 | + { | |
| 23 | + AssetLoader::loadSingleProductAssets(); | |
| 24 | + } | |
| 25 | + | |
| 20 | 26 | public function get_label() |
| 21 | 27 | { |
| 22 | 28 | return esc_html__('Price Range', 'fluent-cart'); |
| 23 | 29 | } |
| @@ -26,12 +32,12 @@ | ||
| 26 | 32 | { |
| 27 | 33 | $this->controls['queryType'] = [ |
| 28 | 34 | 'tab' => 'content', |
| 29 | 35 | 'type' => 'select', |
| 30 | - 'label' => esc_html__('Query Type', 'fluent-cart-bricks-blocks'), | |
| 36 | + 'label' => esc_html__('Query Type', 'fluent-cart'), | |
| 31 | 37 | 'options' => [ |
| 32 | - 'default' => esc_html__('Default', 'fluent-cart-bricks-blocks'), | |
| 33 | - 'custom' => esc_html__('Custom', 'fluent-cart-bricks-blocks'), | |
| 38 | + 'default' => esc_html__('Default', 'fluent-cart'), | |
| 39 | + 'custom' => esc_html__('Custom', 'fluent-cart'), | |
| 34 | 40 | ], |
| 35 | 41 | 'default' => 'default', |
| 36 | 42 | 'inline' => true, |
| 37 | 43 | ]; |
| @@ -38,11 +44,11 @@ | ||
| 38 | 44 | |
| 39 | 45 | $this->controls['productId'] = [ |
| 40 | 46 | 'tab' => 'content', |
| 41 | 47 | 'type' => 'select', |
| 42 | - 'label' => esc_html__('Product', 'fluent-cart-bricks-blocks'), | |
| 48 | + 'label' => esc_html__('Product', 'fluent-cart'), | |
| 43 | 49 | 'options' => BricksLoader::getProductOptions(), |
| 44 | - 'placeholder' => esc_html__('Select a product', 'fluent-cart-bricks-blocks'), | |
| 50 | + 'placeholder' => esc_html__('Select a product', 'fluent-cart'), | |
| 45 | 51 | 'searchable' => true, |
| 46 | 52 | 'rerender' => true, |
| 47 | 53 | 'required' => ['queryType', '=', 'custom'], |
| 48 | 54 | ]; |
| @@ -49,10 +55,10 @@ | ||
| 49 | 55 | |
| 50 | 56 | $this->controls['manualProductId'] = [ |
| 51 | 57 | 'tab' => 'content', |
| 52 | 58 | 'type' => 'text', |
| 53 | - 'label' => esc_html__('Manual Product ID', 'fluent-cart-bricks-blocks'), | |
| 54 | - 'description' => esc_html__('Use this if the product is not available in dropdown.', 'fluent-cart-bricks-blocks'), | |
| 59 | + 'label' => esc_html__('Manual Product ID', 'fluent-cart'), | |
| 60 | + 'description' => esc_html__('Use this if the product is not available in dropdown.', 'fluent-cart'), | |
| 55 | 61 | 'required' => [['queryType', '=', 'custom'], ['productId', '=', '']], |
| 56 | 62 | ]; |
| 57 | 63 | |
| 58 | 64 | $this->controls['hideNoRange'] = [ |
| @@ -94,9 +100,9 @@ | ||
| 94 | 100 | if (!$product) { |
| 95 | 101 | return $this->render_element_placeholder([ |
| 96 | 102 | 'title' => esc_html__( |
| 97 | 103 | 'Select a product', |
| 98 | - 'fluent-cart-bricks-blocks' | |
| 104 | + 'fluent-cart' | |
| 99 | 105 | ), |
| 100 | 106 | ]); |
| 101 | 107 | } |
| 102 | 108 | |