/
home
/
rekodeb
/
webmars
/
wp-content
/
plugins
/
calmor-core
/
widgets
/
Upload File
HOME
<?php namespace calmorCore\Widgets; use Elementor\Widget_Base; use Elementor\Controls_Manager; use Elementor\Group_Control_Background; use Elementor\Group_Control_Typography; use Elementor\Group_Control_Text_Shadow; // Exit if accessed directly if ( ! defined( 'ABSPATH' ) ) { exit; } /** * Text Typing Effect * * Elementor widget for text typing effect. * * @since 1.7.0 */ class calmor_pricing extends Widget_Base { public function get_name() { return 'calmor-pricing'; } public function get_title() { return __( 'Calmer Pricing', 'calmor-core' ); } public function get_icon() { return 'eicon-device-desktop'; } public function get_categories() { return [ 'calmor-elements' ]; } protected function _register_controls() { $pricing = new \Elementor\Repeater(); $this->start_controls_section( 'pricing_features_sec', [ 'label' => __( 'Pricing List', 'calmor-core' ), ] ); $pricing->add_control( 'pricing_title', [ 'label' => __( ' Pricing Title', 'calmor-core' ), 'type' => Controls_Manager::TEXT, 'label_block' => true, 'default' => 'Startup' ] ); $pricing->add_control( 'pricing_amount', [ 'label' => __( ' Pricing Amount', 'calmor-core' ), 'type' => Controls_Manager::TEXT, 'label_block' => true, 'default' => '$10.10' ] ); $pricing->add_control( 'pricing_time', [ 'label' => __( ' Pricing Time', 'calmor-core' ), 'type' => Controls_Manager::TEXT, 'label_block' => true, 'default' => 'Month' ] ); $pricing->add_control( 'pricing_sub_title', [ 'label' => __( ' Pricing Sub Title', 'calmor-core' ), 'type' => Controls_Manager::TEXTAREA, 'label_block' => true, 'default' => 'We create list of assumptions validated in the research phase from the' ] ); $pricing->add_control( 'pricing_content', [ 'label' => __( ' Pricing Content', 'calmor-core' ), 'type' => Controls_Manager::WYSIWYG, 'label_block' => true, 'default' => 'We create list of assumptions validated in the research phase from the' ] ); $pricing->add_control( 'pricing_button', [ 'label' => __( ' Pricing Button Text', 'calmor-core' ), 'type' => Controls_Manager::TEXT, 'label_block' => true, 'default' => 'View more' ] ); $pricing->add_control( 'pricing_button_url', [ 'label' => __( ' Pricing Button URL', 'calmor-core' ), 'type' => Controls_Manager::TEXT, 'label_block' => true, 'default' => '#' ] ); $this->add_control( 'feature_pricing', [ 'label' => __( 'pricing Info', 'calmor-core' ), 'type' => Controls_Manager::REPEATER, 'title_field' => '{{{ pricing_title }}}', 'fields' => $pricing->get_controls(), ] ); $this->end_controls_section(); /** * Style Section */ $this->start_controls_section( 'style_sec', [ 'label' => __( 'General Style ', 'calmor-core' ), 'tab' => Controls_Manager::TAB_STYLE ] ); $this->add_group_control( \Elementor\Group_Control_Background::get_type(), [ 'name' => 'background_pricing', 'label' => esc_html__( 'Section Background', 'calmor-core' ), 'types' => [ 'classic', 'gradient', 'video' ], 'selector' => '{{WRAPPER}} .min_price_area .single_price_item', ] ); $this->add_responsive_control( 'price_section_margin', [ 'label' => esc_html__('Margin', 'calmor-core'), 'type' => \Elementor\Controls_Manager::DIMENSIONS, 'size_units' => ['px', 'em', '%'], 'selectors' => [ '{{WRAPPER}} .min_price_area .single_price_item' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->add_responsive_control( 'price_section_padding', [ 'label' => esc_html__('Padding', 'calmor-core'), 'type' => \Elementor\Controls_Manager::DIMENSIONS, 'size_units' => ['px', 'em', '%'], 'selectors' => [ '{{WRAPPER}} .min_price_area .single_price_item' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->add_group_control( \Elementor\Group_Control_Border::get_type(), [ 'name' => 'border', 'label' => esc_html__( 'Border', 'calmor-core' ), 'selector' => '{{WRAPPER}} .min_price_area .single_price_item', ] ); $this->add_responsive_control( 'price_section_border_radius', [ 'label' => esc_html__('Border Radius', 'calmor-core'), 'type' => \Elementor\Controls_Manager::DIMENSIONS, 'size_units' => ['px', 'em', '%'], 'selectors' => [ '{{WRAPPER}} .min_price_area .single_price_item' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->end_controls_section(); $this->start_controls_section( 'style_sec_content', [ 'label' => __( 'Content Style', 'calmor-core' ), 'tab' => Controls_Manager::TAB_STYLE ] ); $this->add_control( 'price_title_text_color', [ 'label' => esc_html__('Title Color', 'droit-addons'), 'type' => \Elementor\Controls_Manager::COLOR, 'default' => '', 'selectors' => [ '{{WRAPPER}} .min_price_area .single_price_item .price_top h3' => 'color: {{VALUE}};', ], ] ); $this->add_group_control( \Elementor\Group_Control_Typography::get_type(), [ 'name' => 'price_title_text_typography', 'selector' => '{{WRAPPER}} .min_price_area .single_price_item .price_top h3', ] ); $this->add_control( 'price_amount_color', [ 'label' => esc_html__('Amount Color', 'droit-addons'), 'type' => \Elementor\Controls_Manager::COLOR, 'default' => '', 'selectors' => [ '{{WRAPPER}} .min_price_area .single_price_item .price_top h5' => 'color: {{VALUE}};', ], ] ); $this->add_group_control( \Elementor\Group_Control_Typography::get_type(), [ 'name' => 'price_amount_typography', 'selector' => '{{WRAPPER}} .min_price_area .single_price_item .price_top h5', ] ); $this->add_control( 'price_subTitle_color', [ 'label' => esc_html__('Sub Title Color', 'droit-addons'), 'type' => \Elementor\Controls_Manager::COLOR, 'default' => '', 'selectors' => [ '{{WRAPPER}} .min_price_area .single_price_item .price_top p' => 'color: {{VALUE}};', ], ] ); $this->add_group_control( \Elementor\Group_Control_Typography::get_type(), [ 'name' => 'price_sub_title_typography', 'selector' => '{{WRAPPER}} .min_price_area .single_price_item .price_top p', ] ); $this->add_control( 'price_feature_color', [ 'label' => esc_html__('Feature List Color', 'droit-addons'), 'type' => \Elementor\Controls_Manager::COLOR, 'default' => '', 'selectors' => [ '{{WRAPPER}} .min_price_area .single_price_item .price_list li' => 'color: {{VALUE}};', ], ] ); $this->add_group_control( \Elementor\Group_Control_Typography::get_type(), [ 'name' => 'price_feature_typography', 'selector' => '{{WRAPPER}} .min_price_area .single_price_item .price_list li', ] ); $this->add_control( 'price_check_feature_color', [ 'label' => esc_html__('List Icon Color', 'droit-addons'), 'type' => \Elementor\Controls_Manager::COLOR, 'default' => '', 'selectors' => [ '{{WRAPPER}} .min_price_area .single_price_item .price_list li i' => 'color: {{VALUE}};', ], ] ); $this->add_group_control( \Elementor\Group_Control_Typography::get_type(), [ 'name' => 'price_feature_icon_typography', 'selector' => '{{WRAPPER}} .min_price_area .single_price_item .price_list li i', ] ); $this->end_controls_section(); $this->start_controls_section( 'style_sec_button', [ 'label' => __( 'Button Style', 'calmor-core' ), 'tab' => Controls_Manager::TAB_STYLE ] ); $this->add_group_control( \Elementor\Group_Control_Background::get_type(), [ 'name' => 'background_button', 'label' => esc_html__( 'Button Background', 'calmor-core' ), 'types' => [ 'classic', 'gradient', 'video' ], 'selector' => '{{WRAPPER}} .bg_btn_color', ] ); $this->add_responsive_control( 'price_section_margin_button', [ 'label' => esc_html__('Margin', 'calmor-core'), 'type' => \Elementor\Controls_Manager::DIMENSIONS, 'size_units' => ['px', 'em', '%'], 'selectors' => [ '{{WRAPPER}} .bg_btn_color' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->add_responsive_control( 'price_section_padding_button', [ 'label' => esc_html__('Padding', 'calmor-core'), 'type' => \Elementor\Controls_Manager::DIMENSIONS, 'size_units' => ['px', 'em', '%'], 'selectors' => [ '{{WRAPPER}} .bg_btn_color' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->add_group_control( \Elementor\Group_Control_Border::get_type(), [ 'name' => 'border_button', 'label' => esc_html__( 'Border', 'calmor-core' ), 'selector' => '{{WRAPPER}} .bg_btn_color', ] ); $this->add_responsive_control( 'price_section_border_radius_button', [ 'label' => esc_html__('Border Radius', 'calmor-core'), 'type' => \Elementor\Controls_Manager::DIMENSIONS, 'size_units' => ['px', 'em', '%'], 'selectors' => [ '{{WRAPPER}} .bg_btn_color' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->add_control( 'price_button_color', [ 'label' => esc_html__('Button Text Color', 'droit-addons'), 'type' => \Elementor\Controls_Manager::COLOR, 'default' => '', 'selectors' => [ '{{WRAPPER}} .bg_btn_color' => 'color: {{VALUE}};', ], ] ); $this->add_group_control( \Elementor\Group_Control_Typography::get_type(), [ 'name' => 'price_button_typography', 'selector' => '{{WRAPPER}} .bg_btn_color', ] ); $this->end_controls_section(); } protected function render() { $settings = $this->get_settings(); $feature_pricing = isset($settings['feature_pricing']) ? $settings['feature_pricing'] : ''; ?> <!-- Price --> <div class="min_price_area"> <div class="row"> <?php if ( is_array( $feature_pricing ) && count( $feature_pricing ) > 0 ) { $i=1; foreach ( $feature_pricing as $feature_pri ) { ?> <div class="col-lg-4"> <div class="single_price_item wow fadeInLeft" data-wow-delay="0.3s"> <div class="price_top"> <h3><?php echo $feature_pri['pricing_title']; ?></h3> <h5><?php echo $feature_pri['pricing_amount']; ?> <span>/<?php echo $feature_pri['pricing_time']; ?></span></h5> <p><?php echo $feature_pri['pricing_sub_title']; ?></p> </div> <ul class="price_list list-unstyled"> <?php echo $feature_pri['pricing_content']; ?> </ul> <div class="price_bottom"> <a href="<?php echo $feature_pri['pricing_button_url']; ?>" class="bg_btn_color wow fadeInLeft" data-wow-delay="0.1s"> <?php echo $feature_pri['pricing_button']; ?></a> </div> </div> </div> <?php } } ?> </div> </div> <!-- Price --> <?php } }