File: //proc/self/cwd/wp-content/plugins/ftech-plugin/elementor/widgets/pricing-item.php
<?php
/**
* Elementor Single Widget
* @package ftech Tools
* @since 1.0.0
*/
namespace Elementor;
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly.
class Ftech_Pricing_Item extends Widget_Base {
/**
* Get widget name.
*
* Retrieve Elementor widget name.
*
* @since 1.0.0
* @access public
*
* @return string Widget name.
*/
public function get_name() {
return 'go-pricing-table-item';
}
/**
* Get widget title.
*
* Retrieve Elementor widget title.
*
* @since 1.0.0
* @access public
*
* @return string Widget title.
*/
public function get_title() {
return esc_html__( 'Pricing Table Item', 'ftech-plugin' );
}
/**
* Get widget icon.
*
* Retrieve Elementor widget icon.
*
* @since 1.0.0
* @access public
*
* @return string Widget icon.
*/
public function get_icon() {
return 'ftech-custom-icon';
}
/**
* Get widget categories.
*
* Retrieve the list of categories the Elementor widget belongs to.
*
* @since 1.0.0
* @access public
*
* @return array Widget categories.
*/
public function get_categories() {
return [ 'ftech_widgets' ];
}
protected function register_controls() {
$this->start_controls_section(
'int_widget_opt',
[
'label' => esc_html__( 'Pricing Table Style', 'ftech-plugin' ),
'tab' => Controls_Manager::TAB_CONTENT,
]
);
$this->add_control(
'style',
[
'label' => esc_html__( 'Style', 'ftech-plugin' ),
'type' => \Elementor\Controls_Manager::SELECT,
'default' => '1',
'options' => [
'1' => esc_html__( 'Style 1', 'ftech-plugin' ),
'2' => esc_html__( 'Style 2', 'ftech-plugin' ),
]
]
);
$this->end_controls_section();
$this->start_controls_section(
'--pricing-option',
[
'label' => esc_html__( 'Pricing Option', 'ftech-plugin' ),
'tab' => Controls_Manager::TAB_CONTENT,
]
);
$this->add_control(
'type',
[
'label' => __( 'Icon Type', 'gesto-core' ),
'type' => Controls_Manager::CHOOSE,
'label_block' => false,
'options' => [
'icon' => [
'title' => __( 'Icon', 'gesto-core' ),
'icon' => 'far fa-smile',
],
'image' => [
'title' => __( 'Image', 'gesto-core' ),
'icon' => 'fa fa-image',
],
],
'default' => 'icon',
'toggle' => false,
'style_transfer' => true,
]
);
$this->add_control(
'icon', [
'label' => esc_html__( 'Icon', 'gesto-plugin' ),
'type' => Controls_Manager::ICONS,
'label_block' => true,
'condition' => [
'type' => 'icon',
],
]
);
$this->add_control(
'icon_img', [
'label' => esc_html__( 'Icon Image', 'gesto-plugin' ),
'type' => Controls_Manager::MEDIA,
'label_block' => true,
'condition' => [
'type' => 'image',
],
]
);
$this->add_control(
'currency', [
'label' => esc_html__( 'currency', 'ftech-plugin' ),
'default' => esc_html__( '$', 'ftech-plugin' ),
'type' => Controls_Manager::TEXT,
]
);
$this->add_control(
'price', [
'label' => esc_html__( 'Price', 'ftech-plugin' ),
'default' => esc_html__( '350', 'ftech-plugin' ),
'type' => Controls_Manager::TEXT,
]
);
$this->add_control(
'period', [
'label' => esc_html__( 'Period', 'ftech-plugin' ),
'type' => Controls_Manager::TEXT,
]
);
$this->add_control(
'title', [
'label' => esc_html__( 'Title', 'ftech-plugin' ),
'default' => esc_html__( 'Branding', 'ftech-plugin' ),
'type' => Controls_Manager::TEXT,
'label_block' => true,
]
);
$this->add_control(
'description', [
'label' => esc_html__( 'Description', 'ftech-plugin' ),
'default' => esc_html__( 'Discover thousands of easy to customize themes, templates CMS products, made by world-class developers. themes, Templates & CMS products, made by', 'ftech-plugin' ),
'type' => Controls_Manager::TEXT,
'label_block' => true,
]
);
$this->add_control(
'btn_label', [
'label' => esc_html__( 'Button Label', 'ftech-plugin' ),
'type' => Controls_Manager::TEXT,
'label_block' => true,
]
);
$this->add_control(
'btn_link', [
'label' => esc_html__( 'Button Link', 'ftech-plugin' ),
'type' => Controls_Manager::URL,
'label_block' => true,
]
);
$repeater = new \Elementor\Repeater();
$repeater->add_control(
'title', [
'label' => esc_html__( 'Title', 'ftech-plugin' ),
'default' => esc_html__( 'List Title', 'ftech-plugin' ),
'type' => Controls_Manager::TEXT,
'label_block' => true,
]
);
$this->add_control(
'pricing_lists',
[
'label' => esc_html__( 'Add Pricing Item', 'goyto-plugin' ),
'type' => \Elementor\Controls_Manager::REPEATER,
'fields' => $repeater->get_controls(),
'title_field' => '{{{ title }}}',
]
);
$this->add_control(
'custom_cls', [
'label' => esc_html__( 'Custom Class', 'ftech-plugin' ),
'type' => Controls_Manager::TEXT,
'label_block' => true,
]
);
$this->end_controls_section();
// Sub title style
$this->start_controls_section(
'slider_sub_title_style',
[
'label' => esc_html__( 'Sub Title Style', 'ftech-plugin' ),
'tab' => Controls_Manager::TAB_STYLE,
]
);
$this->add_responsive_control(
'margin',
[
'label' => esc_html__( 'Sub Title Margin', 'ftech-plugin' ),
'type' => \Elementor\Controls_Manager::DIMENSIONS,
'size_units' => [ 'px', '%', 'em', 'rem', 'custom' ],
'selectors' => [
'{{WRAPPER}} .elementor-ftech-sub' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
],
]
);
$this->add_control(
'sub_title_color',
[
'label' => esc_html__( 'Sub Title Color', 'ftech-plugin' ),
'type' => \Elementor\Controls_Manager::COLOR,
'selectors' => [
'{{WRAPPER}} .elementor-ftech-sub' => 'color: {{VALUE}}',
],
]
);
$this->add_control(
'sub_title_bg_color',
[
'label' => esc_html__( 'Sub Title BG Color', 'ftech-plugin' ),
'type' => \Elementor\Controls_Manager::COLOR,
'selectors' => [
'{{WRAPPER}} .elementor-ftech-sub' => 'background-color: {{VALUE}}',
],
]
);
// typography
$this->add_group_control(
\Elementor\Group_Control_Typography::get_type(),
[
'name' => 'm_s_typography',
'selector' => '{{WRAPPER}} .elementor-ftech-sub',
]
);
$this->end_controls_section();
// title style
$this->start_controls_section(
'slider_title_style',
[
'label' => esc_html__( 'Title Style', 'ftech-plugin' ),
'tab' => Controls_Manager::TAB_STYLE,
]
);
$this->add_responsive_control(
'title_margin',
[
'label' => esc_html__( 'Sub Title Margin', 'ftech-plugin' ),
'type' => \Elementor\Controls_Manager::DIMENSIONS,
'size_units' => [ 'px', '%', 'em', 'rem', 'custom' ],
'selectors' => [
'{{WRAPPER}} .elementor-gt-heading' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
],
]
);
$this->add_group_control(
\Elementor\Group_Control_Typography::get_type(),
[
'name' => 'm_t_typography',
'selector' => '{{WRAPPER}} .elementor-gt-heading',
]
);
$this->add_control(
'title_color',
[
'label' => esc_html__( 'Title Color', 'ftech-plugin' ),
'type' => \Elementor\Controls_Manager::COLOR,
'selectors' => [
'{{WRAPPER}} .elementor-gt-heading' => 'color: {{VALUE}}',
],
]
);
$this->end_controls_section();
}
protected function render() {
$settings = $this->get_settings_for_display();
require __DIR__ . '/view/pricing-item/pricing-' . $settings['style'] . '.php';
}
}
Plugin::instance()->widgets_manager->register( new Ftech_Pricing_Item() );