controls['hideNoRange'] = [ 'tab' => 'content', 'label' => esc_html__('Hide when max and mix is same', 'fluent-cart'), 'type' => 'checkbox' ]; $this->controls['priceRangeTypography'] = [ 'tab' => 'content', 'label' => esc_html__('Price Range typography', 'fluent-cart'), 'type' => 'typography', 'css' => [ [ 'selector' => '.fct-price-range.fct-product-prices', 'property' => 'font', ], ], ]; } public function render() { $settings = $this->settings; $product = ProductDataSetup::getProductModel($this->post_id); if (empty($product)) { return $this->render_element_placeholder( [ 'title' => esc_html__('For better preview select content to show.', 'fluent-cart'), 'description' => esc_html__('Go to: Settings > Template Settings > Populate Content', 'fluent-cart'), ] ); } if(Arr::get($settings, 'hideNoRange')) { $hasPriceRange = $product->detail->variation_type !== 'simple'; if(!$hasPriceRange) { $min_price = $product->detail->min_price; $max_price = $product->detail->max_price; $hasPriceRange = $max_price && $max_price > $min_price; } if(!$hasPriceRange) { return $this->render_element_placeholder( [ 'description' => esc_html__('Product does not have min-max range', 'fluent-cart'), ] ); } } // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- render_attributes() handles escaping internally echo "
render_attributes( '_root' )}>"; (new ProductRenderer($product))->renderPrices(); echo '
'; } }