File manager - Edit - /home/boiitech111/autorollingright.com/wp-content/themes/carutos/inc/vendor/elementor/widgets/price-table.php
Back
<?php if (!defined('ABSPATH')) { exit; // Exit if accessed directly. } use Elementor\Controls_Manager; use Elementor\Group_Control_Border; use Elementor\Group_Control_Box_Shadow; use Elementor\Group_Control_Typography; use Elementor\Repeater; use Elementor\Group_Control_Background; class WPOPAL_Elementor_Price_table_Widget extends Elementor\Widget_Base { public function get_name() { return 'opal-price-table'; } public function get_title() { return esc_html__('Opal Price Table', 'carutos'); } public function get_categories() { return array('opal-addons'); } public function get_icon() { return 'eicon-price-table'; } protected function register_controls() { $this->start_controls_section( 'section_header', [ 'label' => esc_html__('Header', 'carutos'), ] ); $this->add_control( 'heading', [ 'label' => esc_html__('Title', 'carutos'), 'type' => Controls_Manager::TEXT, 'default' => esc_html__('Pricing Table', 'carutos'), ] ); $this->add_control( 'sub_heading', [ 'label' => esc_html__('Subtitle', 'carutos'), 'type' => Controls_Manager::TEXT, 'default' => esc_html__('I am subtitle', 'carutos'), ] ); $this->end_controls_section(); $this->start_controls_section( 'section_pricing', [ 'label' => esc_html__('Pricing', 'carutos'), ] ); $this->add_control( 'currency_symbol', [ 'label' => esc_html__('Currency Symbol', 'carutos'), 'type' => Controls_Manager::SELECT, 'options' => [ '' => esc_html__('None', 'carutos'), 'dollar' => '$ ' . esc_html_x('Dollar', 'Currency Symbol', 'carutos'), 'euro' => '€ ' . esc_html_x('Euro', 'Currency Symbol', 'carutos'), 'baht' => '฿ ' . esc_html_x('Baht', 'Currency Symbol', 'carutos'), 'franc' => '₣ ' . esc_html_x('Franc', 'Currency Symbol', 'carutos'), 'guilder' => 'ƒ ' . esc_html_x('Guilder', 'Currency Symbol', 'carutos'), 'krona' => 'kr ' . esc_html_x('Krona', 'Currency Symbol', 'carutos'), 'lira' => '₤ ' . esc_html_x('Lira', 'Currency Symbol', 'carutos'), 'peseta' => '₧ ' . esc_html_x('Peseta', 'Currency Symbol', 'carutos'), 'peso' => '₱ ' . esc_html_x('Peso', 'Currency Symbol', 'carutos'), 'pound' => '£ ' . esc_html_x('Pound Sterling', 'Currency Symbol', 'carutos'), 'real' => 'R$ ' . esc_html_x('Real', 'Currency Symbol', 'carutos'), 'ruble' => '₽ ' . esc_html_x('Ruble', 'Currency Symbol', 'carutos'), 'rupee' => '₨ ' . esc_html_x('Rupee', 'Currency Symbol', 'carutos'), 'indian_rupee' => '₹ ' . esc_html_x('Rupee (Indian)', 'Currency Symbol', 'carutos'), 'shekel' => '₪ ' . esc_html_x('Shekel', 'Currency Symbol', 'carutos'), 'yen' => '¥ ' . esc_html_x('Yen/Yuan', 'Currency Symbol', 'carutos'), 'won' => '₩ ' . esc_html_x('Won', 'Currency Symbol', 'carutos'), 'custom' => esc_html__('Custom', 'carutos'), ], 'default' => 'dollar', ] ); $this->add_control( 'currency_symbol_custom', [ 'label' => esc_html__('Custom Symbol', 'carutos'), 'type' => Controls_Manager::TEXT, 'condition' => [ 'currency_symbol' => 'custom', ], ] ); $this->add_control( 'price', [ 'label' => esc_html__('Price', 'carutos'), 'type' => Controls_Manager::TEXT, 'default' => esc_html__('39.99', 'carutos'), ] ); $this->add_control( 'currency_format', [ 'label' => esc_html__('Currency Format', 'carutos'), 'type' => Controls_Manager::SELECT, 'options' => [ '' => esc_html__('1,234.56 (Default)', 'carutos'), ',' => esc_html__('1.234,56', 'carutos'), ], ] ); $this->add_control( 'period', [ 'label' => esc_html__('Period', 'carutos'), 'type' => Controls_Manager::TEXT, 'default' => esc_html__('Monthly', 'carutos'), ] ); $this->end_controls_section(); $this->start_controls_section( 'section_features', [ 'label' => esc_html__('Features', 'carutos'), ] ); $repeater = new Repeater(); $repeater->add_control( 'item_text', [ 'label' => esc_html__('Text', 'carutos'), 'type' => Controls_Manager::TEXT, 'default' => esc_html__('List Item', 'carutos'), ] ); $repeater->add_control( 'item_icon', [ 'label' => esc_html__('Icon', 'carutos'), 'type' => Controls_Manager::ICON, 'default' => 'fa fa-check-circle', ] ); $repeater->add_control( 'item_icon_color', [ 'label' => esc_html__('Icon Color', 'carutos'), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} {{CURRENT_ITEM}} i' => 'color: {{VALUE}}', ], ] ); $this->add_control( 'features_list', [ 'type' => Controls_Manager::REPEATER, 'fields' => $repeater->get_controls(), 'default' => [ [ 'item_text' => esc_html__('List Item #1', 'carutos'), 'item_icon' => 'fa fa-check-circle', ], [ 'item_text' => esc_html__('List Item #2', 'carutos'), 'item_icon' => 'fa fa-check-circle', ], [ 'item_text' => esc_html__('List Item #3', 'carutos'), 'item_icon' => 'fa fa-check-circle', ], ], 'title_field' => '{{{ item_text }}}', ] ); $this->end_controls_section(); $this->start_controls_section( 'section_footer', [ 'label' => esc_html__('Footer', 'carutos'), ] ); $this->add_control( 'button_text', [ 'label' => esc_html__('Button Text', 'carutos'), 'type' => Controls_Manager::TEXT, 'default' => esc_html__('Click Here', 'carutos'), ] ); $this->add_control( 'button_type', [ 'label' => esc_html__('Type', 'carutos'), 'type' => Controls_Manager::SELECT, 'default' => 'default', 'options' => [ 'default' => esc_html__('Default', 'carutos'), 'info' => esc_html__('Info', 'carutos'), 'success' => esc_html__('Success', 'carutos'), 'warning' => esc_html__('Warning', 'carutos'), 'danger' => esc_html__('Danger', 'carutos'), 'primary' => esc_html__('Primary', 'carutos'), 'outline-pirmary' => esc_html__('Outline Pirmary', 'carutos'), 'btn-secondary' => esc_html__('Secondary', 'carutos'), 'btn-line' => esc_html__('Oneline', 'carutos'), ], 'prefix_class' => 'elementor-button-', ] ); $this->add_control( 'button_size', [ 'label' => esc_html__('Size', 'carutos'), 'type' => Controls_Manager::SELECT, 'default' => 'md', 'options' => [ 'xs' => esc_html__('Extra Small', 'carutos'), 'sm' => esc_html__('Small', 'carutos'), 'md' => esc_html__('Medium', 'carutos'), 'lg' => esc_html__('Large', 'carutos'), 'xl' => esc_html__('Extra Large', 'carutos'), ], 'condition' => [ 'button_text!' => '', ], ] ); $this->add_control( 'button_icon', [ 'label' => esc_html__('Button Icon', 'carutos'), 'type' => Controls_Manager::ICON, 'label_block' => true, 'default' => '', ] ); $this->add_control( 'button_icon_align', [ 'label' => esc_html__('Icon Position', 'carutos'), 'type' => Controls_Manager::SELECT, 'default' => 'right', 'options' => [ 'left' => esc_html__('Before', 'carutos'), 'right' => esc_html__('After', 'carutos'), ], 'condition' => [ 'button_icon!' => '', ], ] ); $this->add_control( 'link', [ 'label' => esc_html__('Link', 'carutos'), 'type' => Controls_Manager::URL, 'placeholder' => esc_html__('https://your-link.com', 'carutos'), 'default' => [ 'url' => '#', ], ] ); $this->add_control( 'footer_additional_info', [ 'label' => esc_html__('Additional Info', 'carutos'), 'type' => Controls_Manager::TEXTAREA, 'default' => esc_html__('This is text element', 'carutos'), 'rows' => 2, ] ); $this->end_controls_section(); $this->start_controls_section( 'section_ribbon', [ 'label' => esc_html__('Ribbon', 'carutos'), ] ); $this->add_control( 'show_ribbon', [ 'label' => esc_html__('Show', 'carutos'), 'type' => Controls_Manager::SWITCHER, 'default' => 'yes', 'separator' => 'before', ] ); $this->add_control( 'ribbon_title', [ 'label' => esc_html__('Title', 'carutos'), 'type' => Controls_Manager::TEXT, 'default' => esc_html__('Popular', 'carutos'), 'condition' => [ 'show_ribbon' => 'yes', ], ] ); $this->add_control( 'ribbon_horizontal_position', [ 'label' => esc_html__('Horizontal Position', 'carutos'), 'type' => Controls_Manager::CHOOSE, 'label_block' => false, 'options' => [ 'left' => [ 'title' => esc_html__('Left', 'carutos'), 'icon' => 'eicon-h-align-left', ], 'right' => [ 'title' => esc_html__('Right', 'carutos'), 'icon' => 'eicon-h-align-right', ], ], 'condition' => [ 'show_ribbon' => 'yes', ], ] ); $this->end_controls_section(); $this->start_controls_section( 'section_header_style', [ 'label' => esc_html__('Header', 'carutos'), 'tab' => Controls_Manager::TAB_STYLE, 'show_label' => false, ] ); $this->add_control( 'header_bg_color', [ 'label' => esc_html__('Background Color', 'carutos'), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .elementor-price-table__header' => 'background-color: {{VALUE}}', ], ] ); $this->add_responsive_control( 'header_padding', [ 'label' => esc_html__('Padding', 'carutos'), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => ['px', '%', 'em'], 'selectors' => [ '{{WRAPPER}} .elementor-price-table__header' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->add_control( 'heading_alignment', [ 'label' => esc_html__('Alignment', 'carutos'), 'type' => Controls_Manager::CHOOSE, 'label_block' => false, 'options' => [ 'left' => [ 'title' => esc_html__('Left', 'carutos'), 'icon' => 'fa fa-align-left', ], 'center' => [ 'title' => esc_html__('Center', 'carutos'), 'icon' => 'fa fa-align-center', ], 'right' => [ 'title' => esc_html__('Right', 'carutos'), 'icon' => 'fa fa-align-right', ], ], 'selectors' => [ '{{WRAPPER}} .elementor-price-table__header' => 'text-align: {{VALUE}}', ], ] ); $this->add_control( 'heading_heading_style', [ 'label' => esc_html__('Title', 'carutos'), 'type' => Controls_Manager::HEADING, 'separator' => 'before', ] ); $this->add_control( 'heading_color', [ 'label' => esc_html__('Color', 'carutos'), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .elementor-price-table__heading' => 'color: {{VALUE}}', ], ] ); $this->add_group_control( Group_Control_Typography::get_type(), [ 'name' => 'heading_typography', 'selector' => '{{WRAPPER}} .elementor-price-table__heading', ] ); $this->add_control( 'heading_sub_heading_style', [ 'label' => esc_html__('Sub Title', 'carutos'), 'type' => Controls_Manager::HEADING, 'separator' => 'before', ] ); $this->add_control( 'sub_heading_color', [ 'label' => esc_html__('Color', 'carutos'), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .elementor-price-table__subheading' => 'color: {{VALUE}}', ], ] ); $this->add_group_control( Group_Control_Typography::get_type(), [ 'name' => 'sub_heading_typography', 'selector' => '{{WRAPPER}} .elementor-price-table__subheading', ] ); $this->end_controls_section(); $this->start_controls_section( 'section_pricing_element_style', [ 'label' => esc_html__('Pricing', 'carutos'), 'tab' => Controls_Manager::TAB_STYLE, 'show_label' => false, ] ); $this->add_control( 'pricing_element_bg_color', [ 'label' => esc_html__('Background Color', 'carutos'), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .elementor-price-table__price' => 'background-color: {{VALUE}}', ], ] ); $this->add_responsive_control( 'pricing_element_padding', [ 'label' => esc_html__('Padding', 'carutos'), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => ['px', '%', 'em'], 'selectors' => [ '{{WRAPPER}} .elementor-price-table__price' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->add_control( 'price_color', [ 'label' => esc_html__('Color', 'carutos'), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .elementor-price-table__currency, {{WRAPPER}} .elementor-price-table__integer-part, {{WRAPPER}} .elementor-price-table__fractional-part' => 'color: {{VALUE}};-webkit-text-fill-color: {{VALUE}};-webkit-text-stroke-color: {{VALUE}}'], 'separator' => 'before', ] ); $this->add_group_control( Group_Control_Typography::get_type(), [ 'name' => 'price_typography', 'selector' => '{{WRAPPER}} .elementor-price-table__price', ] ); $this->add_control( 'pricing_alignment', [ 'label' => esc_html__('Alignment', 'carutos'), 'type' => Controls_Manager::CHOOSE, 'label_block' => false, 'options' => [ 'flex-start' => [ 'title' => esc_html__('Left', 'carutos'), 'icon' => 'fa fa-align-left', ], 'center' => [ 'title' => esc_html__('Center', 'carutos'), 'icon' => 'fa fa-align-center', ], 'flex-end' => [ 'title' => esc_html__('Right', 'carutos'), 'icon' => 'fa fa-align-right', ], ], 'selectors' => [ '{{WRAPPER}} .elementor-price-table__price' => 'text-align: {{VALUE}};justify-content: {{VALUE}};', ], ] ); $this->add_control( 'heading_currency_style', [ 'label' => esc_html__('Currency Symbol', 'carutos'), 'type' => Controls_Manager::HEADING, 'separator' => 'before', 'condition' => [ 'currency_symbol!' => '', ], ] ); $this->add_control( 'currency_size', [ 'label' => esc_html__('Size', 'carutos'), 'type' => Controls_Manager::SLIDER, 'range' => [ 'px' => [ 'min' => 0, 'max' => 100, ], ], 'selectors' => [ '{{WRAPPER}} .elementor-price-table__currency' => 'font-size: calc({{SIZE}}em/100)', ], 'condition' => [ 'currency_symbol!' => '', ], ] ); $this->add_control( 'currency_vertical_position', [ 'label' => esc_html__('Vertical Position', 'carutos'), 'type' => Controls_Manager::CHOOSE, 'label_block' => false, 'options' => [ 'top' => [ 'title' => esc_html__('Top', 'carutos'), 'icon' => 'eicon-v-align-top', ], 'middle' => [ 'title' => esc_html__('Middle', 'carutos'), 'icon' => 'eicon-v-align-middle', ], 'bottom' => [ 'title' => esc_html__('Bottom', 'carutos'), 'icon' => 'eicon-v-align-bottom', ], ], 'default' => 'top', 'selectors_dictionary' => [ 'top' => 'flex-start', 'middle' => 'center', 'bottom' => 'flex-end', ], 'selectors' => [ '{{WRAPPER}} .elementor-price-table__currency' => 'align-self: {{VALUE}}', ], 'condition' => [ 'currency_symbol!' => '', ], ] ); $this->add_control( 'fractional_part_style', [ 'label' => esc_html__('Fractional Part', 'carutos'), 'type' => Controls_Manager::HEADING, 'separator' => 'before', ] ); $this->add_control( 'fractional-part_size', [ 'label' => esc_html__('Size', 'carutos'), 'type' => Controls_Manager::SLIDER, 'range' => [ 'px' => [ 'min' => 0, 'max' => 100, ], ], 'selectors' => [ '{{WRAPPER}} .elementor-price-table__integer-part' => 'font-size: calc({{SIZE}}em/100)', ], ] ); $this->add_control( 'fractional_part_vertical_position', [ 'label' => esc_html__('Vertical Position', 'carutos'), 'type' => Controls_Manager::CHOOSE, 'label_block' => false, 'options' => [ 'top' => [ 'title' => esc_html__('Top', 'carutos'), 'icon' => 'eicon-v-align-top', ], 'middle' => [ 'title' => esc_html__('Middle', 'carutos'), 'icon' => 'eicon-v-align-middle', ], 'bottom' => [ 'title' => esc_html__('Bottom', 'carutos'), 'icon' => 'eicon-v-align-bottom', ], ], 'default' => 'top', 'selectors_dictionary' => [ 'top' => 'flex-start', 'middle' => 'center', 'bottom' => 'flex-end', ], 'selectors' => [ '{{WRAPPER}} .elementor-price-table__after-price' => 'justify-content: {{VALUE}}', ], ] ); $this->add_control( 'heading_period_style', [ 'label' => esc_html__('Period', 'carutos'), 'type' => Controls_Manager::HEADING, 'separator' => 'before', 'condition' => [ 'period!' => '', ], ] ); $this->add_control( 'period_color', [ 'label' => esc_html__('Color', 'carutos'), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .elementor-price-table__period' => 'color: {{VALUE}}', ], 'condition' => [ 'period!' => '', ], ] ); $this->add_group_control( Group_Control_Typography::get_type(), [ 'name' => 'period_typography', 'selector' => '{{WRAPPER}} .elementor-price-table__period', 'condition' => [ 'period!' => '', ], ] ); $this->add_control( 'period_position', [ 'label' => esc_html__('Position', 'carutos'), 'type' => Controls_Manager::SELECT, 'label_block' => false, 'options' => [ 'below' => esc_html__('Below', 'carutos'), 'beside' => esc_html__('Beside', 'carutos'), ], 'default' => 'below', 'condition' => [ 'period!' => '', ], ] ); $this->end_controls_section(); $this->start_controls_section( 'section_features_list_style', [ 'label' => esc_html__('Features', 'carutos'), 'tab' => Controls_Manager::TAB_STYLE, 'show_label' => false, ] ); $this->add_control( 'features_list_bg_color', [ 'label' => esc_html__('Background Color', 'carutos'), 'type' => Controls_Manager::COLOR, 'separator' => 'before', 'selectors' => [ '{{WRAPPER}} .elementor-price-table__features-list' => 'background-color: {{VALUE}}', ], ] ); $this->add_responsive_control( 'features_list_padding', [ 'label' => esc_html__('Padding', 'carutos'), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => ['px', '%', 'em'], 'selectors' => [ '{{WRAPPER}} .elementor-price-table__features-list' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->add_control( 'features_list_color', [ 'label' => esc_html__('Color', 'carutos'), 'type' => Controls_Manager::COLOR, 'separator' => 'before', 'selectors' => [ '{{WRAPPER}} .elementor-price-table__features-list' => 'color: {{VALUE}}', ], ] ); $this->add_group_control( Group_Control_Typography::get_type(), [ 'name' => 'features_list_typography', 'selector' => '{{WRAPPER}} .elementor-price-table__features-list li', ] ); $this->add_control( 'features_list_alignment', [ 'label' => esc_html__('Alignment', 'carutos'), 'type' => Controls_Manager::CHOOSE, 'label_block' => false, 'options' => [ 'left' => [ 'title' => esc_html__('Left', 'carutos'), 'icon' => 'fa fa-align-left', ], 'center' => [ 'title' => esc_html__('Center', 'carutos'), 'icon' => 'fa fa-align-center', ], 'right' => [ 'title' => esc_html__('Right', 'carutos'), 'icon' => 'fa fa-align-right', ], ], 'selectors' => [ '{{WRAPPER}} .elementor-price-table__features-list' => 'text-align: {{VALUE}}', ], ] ); $this->add_responsive_control( 'item_width', [ 'label' => esc_html__('Width', 'carutos'), 'type' => Controls_Manager::SLIDER, 'range' => [ '%' => [ 'min' => 25, 'max' => 100, ], ], 'selectors' => [ '{{WRAPPER}} .elementor-price-table__feature-inner' => 'margin-left: calc((100% - {{SIZE}}%)/2); margin-right: calc((100% - {{SIZE}}%)/2)', ], ] ); $this->add_control( 'list_divider', [ 'label' => esc_html__('Divider', 'carutos'), 'type' => Controls_Manager::SWITCHER, 'default' => 'yes', 'separator' => 'before', ] ); $this->add_control( 'divider_style', [ 'label' => esc_html__('Style', 'carutos'), 'type' => Controls_Manager::SELECT, 'options' => [ 'solid' => esc_html__('Solid', 'carutos'), 'double' => esc_html__('Double', 'carutos'), 'dotted' => esc_html__('Dotted', 'carutos'), 'dashed' => esc_html__('Dashed', 'carutos'), ], 'default' => 'solid', 'condition' => [ 'list_divider' => 'yes', ], 'selectors' => [ '{{WRAPPER}} .elementor-price-table__features-list li' => 'border-top-style: {{VALUE}};', ], ] ); $this->add_control( 'divider_color', [ 'label' => esc_html__('Color', 'carutos'), 'type' => Controls_Manager::COLOR, 'default' => '#ddd', 'condition' => [ 'list_divider' => 'yes', ], 'selectors' => [ '{{WRAPPER}} .elementor-price-table__features-list li' => 'border-top-color: {{VALUE}};', ], ] ); $this->add_control( 'divider_weight', [ 'label' => esc_html__('Weight', 'carutos'), 'type' => Controls_Manager::SLIDER, 'default' => [ 'size' => 2, 'unit' => 'px', ], 'range' => [ 'px' => [ 'min' => 1, 'max' => 10, ], ], 'condition' => [ 'list_divider' => 'yes', ], 'selectors' => [ '{{WRAPPER}} .elementor-price-table__features-list li' => 'border-top-width: {{SIZE}}{{UNIT}};', ], ] ); $this->add_control( 'divider_width', [ 'label' => esc_html__('Width', 'carutos'), 'type' => Controls_Manager::SLIDER, 'condition' => [ 'list_divider' => 'yes', ], 'selectors' => [ '{{WRAPPER}} .elementor-price-table__features-list li' => 'margin-left: calc((100% - {{SIZE}}%)/2); margin-right: calc((100% - {{SIZE}}%)/2)', ], ] ); $this->add_control( 'divider_gap', [ 'label' => esc_html__('Gap', 'carutos'), 'type' => Controls_Manager::SLIDER, 'default' => [ 'size' => 15, 'unit' => 'px', ], 'range' => [ 'px' => [ 'min' => 1, 'max' => 50, ], ], 'condition' => [ 'list_divider' => 'yes', ], 'selectors' => [ '{{WRAPPER}} .elementor-price-table__features-list li' => 'padding-top: {{SIZE}}{{UNIT}}; margin-bottom: {{SIZE}}{{UNIT}}', ], ] ); $this->add_control( 'freatures_boder', [ 'label' => esc_html__('Boder', 'carutos'), 'type' => Controls_Manager::SWITCHER, 'default' => 'no', 'separator' => 'before', ] ); $this->add_control( 'freatures_color', [ 'label' => esc_html__('Color', 'carutos'), 'type' => Controls_Manager::COLOR, 'default' => '#ddd', 'condition' => [ 'freatures_boder' => 'yes', ], 'selectors' => [ '{{WRAPPER}} .elementor-price-table__features-list' => 'border-color: {{VALUE}};', ], ] ); $this->add_control( 'freatures_style', [ 'label' => esc_html__('Style', 'carutos'), 'type' => Controls_Manager::SELECT, 'options' => [ 'solid' => esc_html__('Solid', 'carutos'), 'double' => esc_html__('Double', 'carutos'), 'dotted' => esc_html__('Dotted', 'carutos'), 'dashed' => esc_html__('Dashed', 'carutos'), ], 'default' => 'solid', 'condition' => [ 'freatures_boder' => 'yes', ], 'selectors' => [ '{{WRAPPER}} .elementor-price-table__features-list' => 'border-style: {{VALUE}};', ], ] ); $this->add_control( 'features_border_width', [ 'label' => esc_html__('Border Width', 'carutos'), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => ['px', 'em'], 'condition' => [ 'freatures_boder' => 'yes', ], 'selectors' => [ '{{WRAPPER}} .elementor-price-table__features-list' => 'border-width: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->end_controls_section(); $this->start_controls_section( 'section_footer_style', [ 'label' => esc_html__('Footer', 'carutos'), 'tab' => Controls_Manager::TAB_STYLE, 'show_label' => false, ] ); $this->add_control( 'footer_bg_color', [ 'label' => esc_html__('Background Color', 'carutos'), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .elementor-price-table__footer' => 'background-color: {{VALUE}}', ], ] ); $this->add_responsive_control( 'footer_padding', [ 'label' => esc_html__('Padding', 'carutos'), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => ['px', '%', 'em'], 'selectors' => [ '{{WRAPPER}} .elementor-price-table__footer' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->add_control( 'footer_list_alignment', [ 'label' => esc_html__('Alignment', 'carutos'), 'type' => Controls_Manager::CHOOSE, 'label_block' => false, 'options' => [ 'left' => [ 'title' => esc_html__('Left', 'carutos'), 'icon' => 'fa fa-align-left', ], 'center' => [ 'title' => esc_html__('Center', 'carutos'), 'icon' => 'fa fa-align-center', ], 'right' => [ 'title' => esc_html__('Right', 'carutos'), 'icon' => 'fa fa-align-right', ], ], 'selectors' => [ '{{WRAPPER}} .elementor-price-table__footer' => 'text-align: {{VALUE}}', ], ] ); $this->add_control( 'heading_footer_button', [ 'label' => esc_html__('Button', 'carutos'), 'type' => Controls_Manager::HEADING, 'separator' => 'before', 'condition' => [ 'button_text!' => '', ], ] ); $this->start_controls_tabs('tabs_button_style'); $this->start_controls_tab( 'tab_button_normal', [ 'label' => esc_html__('Normal', 'carutos'), 'condition' => [ 'button_text!' => '', ], ] ); $this->add_control( 'button_text_color', [ 'label' => esc_html__('Text Color', 'carutos'), 'type' => Controls_Manager::COLOR, 'default' => '', 'selectors' => [ '{{WRAPPER}} .elementor-price-table__btn' => 'color: {{VALUE}};', ], 'condition' => [ 'button_text!' => '', ], ] ); $this->add_group_control( Group_Control_Typography::get_type(), [ 'name' => 'button_typography', 'selector' => '{{WRAPPER}} .elementor-price-table__btn', 'condition' => [ 'button_text!' => '', ], ] ); $this->add_control( 'button_background_color', [ 'label' => esc_html__('Background Color', 'carutos'), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .elementor-price-table__btn' => 'background-color: {{VALUE}};', ], 'condition' => [ 'button_text!' => '', ], ] ); $this->add_group_control( Group_Control_Background::get_type(), [ 'name' => 'button_background_gradient', 'types' => ['gradient'], 'selector' => '{{WRAPPER}} .elementor-price-table__btn', ] ); $this->add_group_control( Group_Control_Border::get_type(), [ 'name' => 'button_border', 'placeholder' => '1px', 'default' => '1px', 'selector' => '{{WRAPPER}} .elementor-price-table__btn', 'condition' => [ 'button_text!' => '', ], 'separator' => 'before', ] ); $this->add_control( 'button_border_radius', [ 'label' => esc_html__('Border Radius', 'carutos'), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => ['px', '%'], 'selectors' => [ '{{WRAPPER}} .elementor-price-table__btn' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], 'condition' => [ 'button_text!' => '', ], ] ); $this->add_control( 'button_text_padding', [ 'label' => esc_html__('Text Padding', 'carutos'), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => ['px', 'em', '%'], 'selectors' => [ '{{WRAPPER}} .elementor-price-table__btn' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], 'condition' => [ 'button_text!' => '', ], ] ); $this->end_controls_tab(); $this->start_controls_tab( 'tab_button_hover', [ 'label' => esc_html__('Hover', 'carutos'), 'condition' => [ 'button_text!' => '', ], ] ); $this->add_control( 'button_hover_color', [ 'label' => esc_html__('Text Color', 'carutos'), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .elementor-price-table__btn:hover' => 'color: {{VALUE}};', ], 'condition' => [ 'button_text!' => '', ], ] ); $this->add_control( 'button_background_hover_color', [ 'label' => esc_html__('Background Color', 'carutos'), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .elementor-price-table__btn:hover' => 'background-color: {{VALUE}};', ], 'condition' => [ 'button_text!' => '', ], ] ); $this->add_group_control( Group_Control_Background::get_type(), [ 'name' => 'button_background_gradient_hover', 'types' => ['gradient'], 'selector' => '{{WRAPPER}} .elementor-price-table__btn:hover', ] ); $this->add_control( 'button_hover_border_color', [ 'label' => esc_html__('Border Color', 'carutos'), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .elementor-price-table__btn:hover' => 'border-color: {{VALUE}};', ], 'condition' => [ 'button_text!' => '', ], ] ); $this->add_control( 'button_hover_animation', [ 'label' => esc_html__('Animation', 'carutos'), 'type' => Controls_Manager::HOVER_ANIMATION, 'condition' => [ 'button_text!' => '', ], ] ); $this->end_controls_tab(); $this->end_controls_tabs(); $this->add_control( 'heading_additional_info', [ 'label' => esc_html__('Additional Info', 'carutos'), 'type' => Controls_Manager::HEADING, 'separator' => 'before', 'condition' => [ 'footer_additional_info!' => '', ], ] ); $this->add_control( 'additional_info_color', [ 'label' => esc_html__('Color', 'carutos'), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .elementor-price-table__additional_info' => 'color: {{VALUE}}', ], 'condition' => [ 'footer_additional_info!' => '', ], ] ); $this->add_group_control( Group_Control_Typography::get_type(), [ 'name' => 'additional_info_typography', 'selector' => '{{WRAPPER}} .elementor-price-table__additional_info', 'condition' => [ 'footer_additional_info!' => '', ], ] ); $this->add_control( 'additional_info_margin', [ 'label' => esc_html__('Margin', 'carutos'), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => ['px', '%', 'em'], 'default' => [ 'top' => 15, 'right' => 30, 'bottom' => 0, 'left' => 30, 'unit' => 'px', ], 'selectors' => [ '{{WRAPPER}} .elementor-price-table__additional_info' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}', ], 'condition' => [ 'footer_additional_info!' => '', ], ] ); $this->end_controls_section(); $this->start_controls_section( 'section_ribbon_style', [ 'label' => esc_html__('Ribbon', 'carutos'), 'tab' => Controls_Manager::TAB_STYLE, 'show_label' => false, 'condition' => [ 'show_ribbon' => 'yes', ], ] ); $this->add_control( 'ribbon_bg_color', [ 'label' => esc_html__('Background Color', 'carutos'), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .elementor-price-table__ribbon-inner' => 'background-color: {{VALUE}}', ], ] ); $ribbon_distance_transform = is_rtl() ? 'translateY(-50%) translateX({{SIZE}}{{UNIT}}) rotate(-45deg)' : 'translateY(-50%) translateX(-50%) translateX({{SIZE}}{{UNIT}}) rotate(-45deg)'; $this->add_responsive_control( 'ribbon_distance', [ 'label' => esc_html__('Distance', 'carutos'), 'type' => Controls_Manager::SLIDER, 'range' => [ 'px' => [ 'min' => 0, 'max' => 50, ], ], 'selectors' => [ '{{WRAPPER}} .elementor-price-table__ribbon-inner' => 'margin-top: {{SIZE}}{{UNIT}}; transform: ' . $ribbon_distance_transform, ], ] ); $this->add_control( 'ribbon_text_color', [ 'label' => esc_html__('Text Color', 'carutos'), 'type' => Controls_Manager::COLOR, 'default' => '#ffffff', 'separator' => 'before', 'selectors' => [ '{{WRAPPER}} .elementor-price-table__ribbon-inner' => 'color: {{VALUE}}', ], ] ); $this->add_group_control( Group_Control_Typography::get_type(), [ 'name' => 'ribbon_typography', 'selector' => '{{WRAPPER}} .elementor-price-table__ribbon-inner', ] ); $this->add_group_control( Group_Control_Box_Shadow::get_type(), [ 'name' => 'box_shadow', 'selector' => '{{WRAPPER}} .elementor-price-table__ribbon-inner', ] ); $this->end_controls_section(); } private function get_currency_symbol($symbol_name) { $symbols = [ 'dollar' => '$', 'euro' => '€', 'franc' => '₣', 'pound' => '£', 'ruble' => '₽', 'shekel' => '₪', 'baht' => '฿', 'yen' => '¥', 'won' => '₩', 'guilder' => 'ƒ', 'peso' => '₱', 'peseta' => '₧', 'lira' => '₤', 'rupee' => '₨', 'indian_rupee' => '₹', 'real' => 'R$', 'krona' => 'kr', ]; return isset($symbols[$symbol_name]) ? $symbols[$symbol_name] : ''; } protected function render() { $settings = $this->get_settings(); $image_html = ''; $symbol = ''; if (!empty($settings['currency_symbol'])) { if ('custom' !== $settings['currency_symbol']) { $symbol = $this->get_currency_symbol($settings['currency_symbol']); } else { $symbol = $settings['currency_symbol_custom']; } } $currency_format = empty($settings['currency_format']) ? '.' : $settings['currency_format']; $price = explode($currency_format, $settings['price']); $intpart = $price[0]; $fraction = ''; if (2 === count($price)) { $fraction = $price[1]; } $this->add_render_attribute('button_text', 'class', [ 'elementor-price-table__btn', 'elementor-button', 'elementor-size-' . $settings['button_size'], ]); if (!empty($settings['link']['url'])) { $this->add_render_attribute('button_text', 'href', $settings['link']['url']); if (!empty($settings['link']['is_external'])) { $this->add_render_attribute('button_text', 'target', '_blank'); } } if (!empty($settings['button_hover_animation'])) { $this->add_render_attribute('button_text', 'class', 'elementor-animation-' . $settings['button_hover_animation']); } $this->add_render_attribute('heading', 'class', 'elementor-price-table__heading'); $this->add_render_attribute('sub_heading', 'class', 'elementor-price-table__subheading'); $this->add_render_attribute('period', 'class', ['elementor-price-table__period', 'elementor-typo-excluded']); $this->add_render_attribute('footer_additional_info', 'class', 'elementor-price-table__additional_info'); $this->add_render_attribute('ribbon_title', 'class', 'elementor-price-table__ribbon-inner'); $this->add_inline_editing_attributes('heading', 'none'); $this->add_inline_editing_attributes('sub_heading', 'none'); $this->add_inline_editing_attributes('period', 'none'); $this->add_inline_editing_attributes('footer_additional_info'); $this->add_inline_editing_attributes('button_text'); $this->add_inline_editing_attributes('ribbon_title'); if (!empty($settings['button_icon'])) { $this->add_render_attribute('icon-align', 'class', 'elementor-button-icon'); $this->add_render_attribute('icon-align', 'class', 'elementor-align-icon-' . $settings['button_icon_align']); } $period_position = $settings['period_position']; $period_element = '<span ' . $this->get_render_attribute_string('period') . '>' . $settings['period'] . '</span>'; ?> <div class="elementor-price-table"> <?php if ($settings['heading'] || $settings['sub_heading']) : ?> <div class="elementor-price-table__header"> <?php if (!empty($settings['heading'])) : ?> <h3 <?php echo wp_kses_post( $this->get_render_attribute_string('heading') ); // WPCS: XSS ok.?>> <?php echo esc_html($settings['heading']); ?> </h3> <?php endif; ?> <?php if (!empty($settings['sub_heading'])) : ?> <span <?php echo wp_kses_post( $this->get_render_attribute_string('sub_heading') ); // WPCS: XSS ok.?>> <?php echo esc_html($settings['sub_heading']); ?> </span> <?php endif; ?> </div> <?php endif; ?> <div class="elementor-price-table__price"> <?php if (!empty($symbol)) : ?> <span class="elementor-price-table__currency"><?php echo esc_html($symbol); ?></span> <?php endif; ?> <?php if (!empty($intpart) || 0 <= $intpart) : ?> <span class="elementor-price-table__integer-part"><?php echo esc_html($intpart); ?></span> <?php endif; ?> <?php if ('' !== $fraction || (!empty($settings['period']) && 'beside' === $period_position)) : ?> <div class="elementor-price-table__after-price"> <span class="elementor-price-table__fractional-part"><?php echo esc_html($fraction); ?></span> <?php if (!empty($settings['period']) && 'beside' === $period_position) : ?> <?php echo wp_kses_post($period_element); ?> <?php endif; ?> </div> <?php endif; ?> <?php if (!empty($settings['period']) && 'below' === $period_position) : ?> <?php echo wp_kses_post($period_element); ?> <?php endif; ?> </div> <?php if (!empty($settings['features_list'])) : ?> <ul class="elementor-price-table__features-list"> <?php foreach ($settings['features_list'] as $index => $item) : $repeater_setting_key = $this->get_repeater_setting_key('item_text', 'features_list', $index); $this->add_inline_editing_attributes($repeater_setting_key); ?> <li class="elementor-repeater-item-<?php echo esc_attr($item['_id']); ?>"> <div class="elementor-price-table__feature-inner"> <?php if (!empty($item['item_icon'])) : ?> <i class="<?php echo esc_attr($item['item_icon']); ?>" aria-hidden="true"></i> <?php endif; ?> <?php if (!empty($item['item_text'])) : ?> <span <?php echo wp_kses_post( $this->get_render_attribute_string($repeater_setting_key) ); // WPCS: XSS ok. ?>> <?php echo esc_html($item['item_text']); ?> </span> <?php else : echo ' '; endif; ?> </div> </li> <?php endforeach; ?> </ul> <?php endif; ?> <?php if (!empty($settings['button_text']) || !empty($settings['footer_additional_info'])) : ?> <div class="elementor-price-table__footer"> <?php if (!empty($settings['button_text'])) : ?> <a <?php echo wp_kses_post( $this->get_render_attribute_string('button_text') ); // WPCS: XSS ok.?>> <?php if (!empty($settings['button_icon'])) : ?> <span <?php echo wp_kses_post( $this->get_render_attribute_string('icon-align') ); // WPCS: XSS ok.?>> <i class="<?php echo esc_attr($settings['button_icon']); ?>" aria-hidden="true"></i> </span> <?php endif; ?> <?php echo esc_html($settings['button_text']); ?> </a> <?php endif; ?> <?php if (!empty($settings['footer_additional_info'])) : ?> <div <?php echo wp_kses_post( $this->get_render_attribute_string('footer_additional_info') ); // WPCS: XSS ok.?>><?php echo wp_kses_post($settings['footer_additional_info']); ?></div> <?php endif; ?> </div> <?php endif; ?> </div> <?php if ('yes' === $settings['show_ribbon'] && !empty($settings['ribbon_title'])) : $this->add_render_attribute('ribbon-wrapper', 'class', 'elementor-price-table__ribbon'); if (!empty($settings['ribbon_horizontal_position'])) : $this->add_render_attribute('ribbon-wrapper', 'class', 'elementor-ribbon-' . $settings['ribbon_horizontal_position']); endif; ?> <div <?php echo wp_kses_post( $this->get_render_attribute_string('ribbon-wrapper') ); // WPCS: XSS ok. ?>> <div <?php echo wp_kses_post( $this->get_render_attribute_string('ribbon_title') ); // WPCS: XSS ok. ?>><?php echo esc_html($settings['ribbon_title']); ?></div> </div> <?php endif; } protected function _content_template() { ?> <# var symbols = { dollar: '$', euro: '€', franc: '₣', pound: '£', ruble: '₽', shekel: '₪', baht: '฿', yen: '¥', won: '₩', guilder: 'ƒ', peso: '₱', peseta: '₧', lira: '₤', rupee: '₨', indian_rupee: '₹', real: 'R$', krona: 'kr' }; var symbol = ''; if ( settings.currency_symbol ) { if ( 'custom' !== settings.currency_symbol ) { symbol = symbols[ settings.currency_symbol ] || ''; } else { symbol = settings.currency_symbol_custom; } } if ( settings.button_hover_animation ) { buttonClasses += ' elementor-animation-' + settings.button_hover_animation; } var buttonClasses = 'elementor-price-table__btn elementor-button elementor-size-' + settings.button_size; view.addRenderAttribute( 'heading', 'class', 'elementor-price-table__heading' ); view.addRenderAttribute( 'sub_heading', 'class', 'elementor-price-table__subheading' ); view.addRenderAttribute( 'period', 'class', ['elementor-price-table__period', 'elementor-typo-excluded'] ); view.addRenderAttribute( 'footer_additional_info', 'class', 'elementor-price-table__additional_info' ); view.addRenderAttribute( 'button_text', 'class', buttonClasses ); view.addRenderAttribute( 'ribbon_title', 'class', 'elementor-price-table__ribbon-inner' ); view.addInlineEditingAttributes( 'heading', 'none' ); view.addInlineEditingAttributes( 'sub_heading', 'none' ); view.addInlineEditingAttributes( 'period', 'none' ); view.addInlineEditingAttributes( 'footer_additional_info' ); view.addInlineEditingAttributes( 'button_text' ); view.addInlineEditingAttributes( 'ribbon_title' ); view.addRenderAttribute( 'icon-align', 'class', 'elementor-button-icon' ); view.addRenderAttribute( 'icon-align', 'class', 'elementor-align-icon-' + settings.button_icon_align); view.addInlineEditingAttributes( 'icon-align' ); var currencyFormat = settings.currency_format || '.', price = settings.price.split( currencyFormat ), intpart = price[0], fraction = price[1], periodElement = '<span ' + view.getRenderAttributeString( "period" ) + '>' + settings.period + '</span>'; #> <div class="elementor-price-table"> <# if ( settings.heading || settings.sub_heading ) { #> <div class="elementor-price-table__header"> <# if ( settings.heading ) { #> <h3 {{{ view.getRenderAttributeString( 'heading' ) }}}>{{{ settings.heading }}}</h3> <# } #> <# if ( settings.sub_heading ) { #> <span {{{ view.getRenderAttributeString( 'sub_heading' ) }}}>{{{ settings.sub_heading }}}</span> <# } #> </div> <# } #> <div class="elementor-price-table__price"> <# if ( ! _.isEmpty( symbol ) ) { #> <span class="elementor-price-table__currency">{{{ symbol }}}</span> <# } #> <# if ( intpart ) { #> <span class="elementor-price-table__integer-part">{{{ intpart }}}</span> <# } #> <div class="elementor-price-table__after-price"> <# if ( fraction ) { #> <span class="elementor-price-table__fractional-part">{{{ fraction }}}</span> <# } #> <# if ( settings.period && 'beside' === settings.period_position ) { #> {{{ periodElement }}} <# } #> </div> <# if ( settings.period && 'below' === settings.period_position ) { #> {{{ periodElement }}} <# } #> </div> <# if ( settings.features_list ) { #> <ul class="elementor-price-table__features-list"> <# _.each( settings.features_list, function( item, index ) { var featureKey = view.getRepeaterSettingKey( 'item_text', 'features_list', index ); view.addInlineEditingAttributes( featureKey ); #> <li class="elementor-repeater-item-{{ item._id }}"> <div class="elementor-price-table__feature-inner"> <# if ( item.item_icon ) { #> <i class="{{ item.item_icon }}" aria-hidden="true"></i> <# } #> <# if ( ! _.isEmpty( item.item_text.trim() ) ) { #> <span {{{ view.getRenderAttributeString( featureKey ) }}}>{{{ item.item_text }}}</span> <# } else { #> <# } #> </div> </li> <# } ); #> </ul> <# } #> <# if ( settings.button_text || settings.footer_additional_info ) { #> <div class="elementor-price-table__footer"> <# if ( settings.button_text ) { #> <a href="#" {{{ view.getRenderAttributeString( 'button_text' ) }}}> <# if ( settings.button_icon ) { #> <span {{{ view.getRenderAttributeString( 'icon-align' ) }}}> <i class="{{{settings.button_icon}}}" aria-hidden="true"></i> </span> <# } #> {{{ settings.button_text }}} </a> <# } #> <# if ( settings.footer_additional_info ) { #> <p {{{ view.getRenderAttributeString( 'footer_additional_info' ) }}}>{{{ settings.footer_additional_info }}}</p> <# } #> </div> <# } #> </div> <# if ( 'yes' === settings.show_ribbon && settings.ribbon_title ) { var ribbonClasses = 'elementor-price-table__ribbon'; if ( settings.ribbon_horizontal_position ) { ribbonClasses += ' elementor-ribbon-' + settings.ribbon_horizontal_position; } #> <div class="{{ ribbonClasses }}"> <div {{{ view.getRenderAttributeString( 'ribbon_title' ) }}}>{{{ settings.ribbon_title }}} </div> </div> <# } #> <?php } } $widgets_manager->register(new WPOPAL_Elementor_Price_table_Widget());
| ver. 1.4 |
Github
|
.
| PHP 8.1.34 | Generation time: 0.06 |
proxy
|
phpinfo
|
Settings