| Server IP : 69.72.244.102 / Your IP : 216.73.216.164 Web Server : LiteSpeed System : Linux s3434.fra1.stableserver.net 4.18.0-513.24.1.lve.2.el8.x86_64 #1 SMP Fri May 24 12:42:50 UTC 2024 x86_64 User : konzalta ( 1271) PHP Version : 7.4.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /proc/thread-self/cwd/wp-content/plugins/portx-core/include/elementor/ |
Upload File : |
<?php
namespace TPCore\Widgets;
use Elementor\Widget_Base;
use \Elementor\Group_Control_Text_Shadow;
use \Elementor\Repeater;
use \Elementor\Control_Media;
use \Elementor\Utils;
Use \Elementor\Core\Schemes\Typography;
use \Elementor\Controls_Manager;
use \Elementor\Group_Control_Border;
use \Elementor\Group_Control_Box_Shadow;
use \Elementor\Group_Control_Typography;
use \Elementor\Group_Control_Image_Size;
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
/**
* Tp Core
*
* Elementor widget for hello world.
*
* @since 1.0.0
*/
class TP_Pricing extends Widget_Base {
use \TPCore\Widgets\TPCoreElementFunctions;
/**
* Retrieve the widget name.
*
* @since 1.0.0
*
* @access public
*
* @return string Widget name.
*/
public function get_name() {
return 'tp-pricing';
}
/**
* Retrieve the widget title.
*
* @since 1.0.0
*
* @access public
*
* @return string Widget title.
*/
public function get_title() {
return __( 'Pricing', 'tpcore' );
}
/**
* Retrieve the widget icon.
*
* @since 1.0.0
*
* @access public
*
* @return string Widget icon.
*/
public function get_icon() {
return 'tp-icon';
}
/**
* Retrieve the list of categories the widget belongs to.
*
* Used to determine where to display the widget in the editor.
*
* Note that currently Elementor supports only one category.
* When multiple categories passed, Elementor uses the first one.
*
* @since 1.0.0
*
* @access public
*
* @return array Widget categories.
*/
public function get_categories() {
return [ 'tpcore' ];
}
/**
* Retrieve the list of scripts the widget depended on.
*
* Used to set scripts dependencies required to run the widget.
*
* @since 1.0.0
*
* @access public
*
* @return array Widget scripts dependencies.
*/
public function get_script_depends() {
return [ 'tpcore' ];
}
/**
* Register the widget controls.
*
* Adds different input fields to allow the user to change and customize the widget settings.
*
* @since 1.0.0
*
* @access protected
*/
protected function register_controls() {
$this->start_controls_section(
'_section_design_title',
[
'label' => __('Design Style', 'tpcore'),
'tab' => Controls_Manager::TAB_CONTENT,
]
);
$this->add_control(
'tp_design_style',
[
'label' => esc_html__('Select Layout', 'tpcore'),
'type' => Controls_Manager::SELECT,
'options' => [
'layout-1' => esc_html__('Layout 1', 'tpcore'),
'layout-2' => esc_html__('Layout 2', 'tpcore'),
],
'default' => 'layout-1',
]
);
$this->add_control(
'active_price',
[
'label' => __('Active Price', 'tpcore'),
'type' => Controls_Manager::SWITCHER,
'label_on' => __('Show', 'tpcore'),
'label_off' => __('Hide', 'tpcore'),
'return_value' => 'yes',
'default' => false,
'style_transfer' => true,
]
);
$this->add_control(
'tp_shape',
[
'label' => __('Shape Show', 'tpcore'),
'type' => Controls_Manager::SWITCHER,
'label_on' => __('Show', 'tpcore'),
'label_off' => __('Hide', 'tpcore'),
'return_value' => 'yes',
'default' => false,
'style_transfer' => true,
]
);
$this->end_controls_section();
// Header
$this->start_controls_section(
'_section_header',
[
'label' => __('Header', 'tpcore'),
'tab' => Controls_Manager::TAB_CONTENT,
]
);
$this->add_control(
'title',
[
'label' => __('Title', 'tpcore'),
'type' => Controls_Manager::TEXT,
'label_block' => true,
'default' => __('Basic', 'tpcore'),
'dynamic' => [
'active' => true
]
]
);
$this->add_control(
'sub_title',
[
'label' => __('Sub Title', 'tpcore'),
'type' => Controls_Manager::TEXT,
'label_block' => true,
'default' => __('Save 20%', 'tpcore'),
'dynamic' => [
'active' => true
]
]
);
$this->end_controls_section();
// Header
$this->start_controls_section(
'_section_secondary_header',
[
'label' => __('Secondary Header', 'tpcore'),
'tab' => Controls_Manager::TAB_CONTENT,
]
);
$this->add_control(
'secondary_title',
[
'label' => __('Title', 'tpcore'),
'type' => Controls_Manager::TEXTAREA,
'label_block' => true,
'default' => __('Basic', 'tpcore'),
'dynamic' => [
'active' => true
]
]
);
$this->add_control(
'secondary_sub_title',
[
'label' => __('Sub Title', 'tpcore'),
'type' => Controls_Manager::TEXT,
'label_block' => true,
'default' => __('Save 20%', 'tpcore'),
'dynamic' => [
'active' => true
]
]
);
$this->end_controls_section();
$this->start_controls_section(
'_section_pricing',
[
'label' => __('Pricing', 'tpcore'),
'tab' => Controls_Manager::TAB_CONTENT,
]
);
$this->add_control(
'currency',
[
'label' => __('Currency', 'tpcore'),
'type' => Controls_Manager::SELECT,
'label_block' => false,
'options' => [
'' => __('None', 'tpcore'),
'baht' => '฿ ' . _x('Baht', 'Currency Symbol', 'tpcore'),
'bdt' => '৳ ' . _x('BD Taka', 'Currency Symbol', 'tpcore'),
'dollar' => '$ ' . _x('Dollar', 'Currency Symbol', 'tpcore'),
'euro' => '€ ' . _x('Euro', 'Currency Symbol', 'tpcore'),
'franc' => '₣ ' . _x('Franc', 'Currency Symbol', 'tpcore'),
'guilder' => 'ƒ ' . _x('Guilder', 'Currency Symbol', 'tpcore'),
'krona' => 'kr ' . _x('Krona', 'Currency Symbol', 'tpcore'),
'lira' => '₤ ' . _x('Lira', 'Currency Symbol', 'tpcore'),
'peso' => '₱ ' . _x('Peso', 'Currency Symbol', 'tpcore'),
'pound' => '£ ' . _x('Pound Sterling', 'Currency Symbol', 'tpcore'),
'real' => 'R$ ' . _x('Real', 'Currency Symbol', 'tpcore'),
'ruble' => '₽ ' . _x('Ruble', 'Currency Symbol', 'tpcore'),
'indian_rupee' => '₹ ' . _x('Rupee (Indian)', 'Currency Symbol', 'tpcore'),
'shekel' => '₪ ' . _x('Shekel', 'Currency Symbol', 'tpcore'),
'won' => '₩ ' . _x('Won', 'Currency Symbol', 'tpcore'),
'yen' => '¥ ' . _x('Yen/Yuan', 'Currency Symbol', 'tpcore'),
'custom' => __('Custom', 'tpcore'),
],
'default' => 'dollar',
]
);
$this->add_control(
'currency_custom',
[
'label' => __('Custom Symbol', 'tpcore'),
'type' => Controls_Manager::TEXT,
'condition' => [
'currency' => 'custom',
],
'dynamic' => [
'active' => true,
]
]
);
$this->add_control(
'price',
[
'label' => __('Price', 'tpcore'),
'type' => Controls_Manager::TEXT,
'default' => '9.99',
'dynamic' => [
'active' => true
]
]
);
$this->add_control(
'month_year',
[
'label' => __('Month / Year', 'tpcore'),
'type' => Controls_Manager::TEXT,
'default' => 'mo',
'dynamic' => [
'active' => true
]
]
);
$this->add_control(
'tp_box_icon_type',
[
'label' => esc_html__('Select Icon Type', 'tpcore'),
'type' => \Elementor\Controls_Manager::SELECT,
'default' => 'image',
'options' => [
'image' => esc_html__('Image', 'tpcore'),
'icon' => esc_html__('Icon', 'tpcore'),
'svg' => esc_html__('SVG', 'tpcore'),
],
]
);
$this->add_control(
'tp_box_icon_svg',
[
'show_label' => false,
'type' => Controls_Manager::TEXTAREA,
'label_block' => true,
'placeholder' => esc_html__('SVG Code Here', 'tpcore'),
'condition' => [
'tp_box_icon_type' => 'svg'
]
]
);
$this->add_control(
'tp_box_icon_image',
[
'label' => esc_html__('Upload Icon Image', 'tpcore'),
'type' => Controls_Manager::MEDIA,
'default' => [
'url' => Utils::get_placeholder_image_src(),
],
'condition' => [
'tp_box_icon_type' => 'image',
]
]
);
if (tp_is_elementor_version('<', '2.6.0')) {
$this->add_control(
'tp_box_icon',
[
'show_label' => false,
'type' => Controls_Manager::ICON,
'label_block' => true,
'default' => 'fa fa-star',
'condition' => [
'tp_box_icon_type' => 'icon'
]
]
);
} else {
$this->add_control(
'tp_box_selected_icon',
[
'show_label' => false,
'type' => Controls_Manager::ICONS,
'fa4compatibility' => 'icon',
'label_block' => true,
'default' => [
'value' => 'fas fa-star',
'library' => 'solid',
],
'condition' => [
'tp_box_icon_type' => 'icon'
]
]
);
}
$this->add_control(
'tp_box_icon_type_2',
[
'label' => esc_html__('Select Icon Type', 'tpcore'),
'type' => \Elementor\Controls_Manager::SELECT,
'default' => 'image',
'options' => [
'image' => esc_html__('Image', 'tpcore'),
'icon' => esc_html__('Icon', 'tpcore'),
'svg' => esc_html__('SVG', 'tpcore'),
],
]
);
$this->add_control(
'tp_box_icon_image_2',
[
'label' => esc_html__('Upload Icon Image', 'tpcore'),
'type' => Controls_Manager::MEDIA,
'default' => [
'url' => Utils::get_placeholder_image_src(),
],
'condition' => [
'tp_box_icon_type_2' => 'image',
]
]
);
if (tp_is_elementor_version('<', '2.6.0')) {
$this->add_control(
'tp_box_icon_2',
[
'show_label' => false,
'type' => Controls_Manager::ICON,
'label_block' => true,
'default' => 'fa fa-star',
'condition' => [
'tp_box_icon_type_2' => 'icon'
]
]
);
} else {
$this->add_control(
'tp_box_selected_icon_2',
[
'show_label' => false,
'type' => Controls_Manager::ICONS,
'fa4compatibility' => 'icon',
'label_block' => true,
'default' => [
'value' => 'fas fa-star',
'library' => 'solid',
],
'condition' => [
'tp_box_icon_type_2' => 'icon'
]
]
);
}
$this->add_group_control(
Group_Control_Image_Size::get_type(),
[
'name' => 'thumbnail', // // Usage: `{name}_size` and `{name}_custom_dimension`, in this case `thumbnail_size` and `thumbnail_custom_dimension`.
'exclude' => ['custom'],
// 'default' => 'tp-post-thumb',
]
);
$this->end_controls_section();
$this->start_controls_section(
'_section_features',
[
'label' => __('Features', 'tpcore'),
]
);
$this->add_control(
'show_features',
[
'label' => __('Show', 'tpcore'),
'type' => Controls_Manager::SWITCHER,
'label_on' => __('Show', 'tpcore'),
'label_off' => __('Hide', 'tpcore'),
'return_value' => 'yes',
'default' => 'yes',
'style_transfer' => true,
]
);
$repeater = new Repeater();
$repeater->add_control(
'tp_feature_unavailable',
[
'label' => __('Feature Hide ?', 'bdevs-element'),
'type' => Controls_Manager::SWITCHER,
'label_on' => __('Show', 'bdevs-element'),
'label_off' => __('Hide', 'bdevs-element'),
'return_value' => 'yes',
'default' => 'yes',
'style_transfer' => true,
]
);
$repeater->add_control(
'text',
[
'label' => __('Text', 'tpcore'),
'type' => Controls_Manager::TEXTAREA,
'default' => __('Exciting Feature', 'tpcore'),
'dynamic' => [
'active' => true
]
]
);
$this->add_control(
'tp_features_extra_charge',
[
'label' => esc_html__( 'Extra Charges 01', 'tpcore' ),
'type' => \Elementor\Controls_Manager::TEXT,
'default' => esc_html__( 'Includes', 'tpcore' ),
'placeholder' => esc_html__( 'Placeholder Text', 'tpcore' ),
'condition' => [
'tp_design_style' => ['layout-1','layout-2']
]
]
);
$this->add_control(
'tp_features_extra_charge_2',
[
'label' => esc_html__( 'Extra Charges 02', 'tpcore' ),
'type' => \Elementor\Controls_Manager::TEXT,
'default' => esc_html__( 'Includes', 'tpcore' ),
'placeholder' => esc_html__( 'Placeholder Text', 'tpcore' ),
'condition' => [
'tp_design_style' => ['layout-1','layout-2']
]
]
);
$this->add_control(
'features_list',
[
'type' => Controls_Manager::REPEATER,
'fields' => $repeater->get_controls(),
'show_label' => false,
'default' => [
[
'text' => __('Standard Feature', 'tpcore'),
'icon' => 'fa fa-check',
],
[
'text' => __('Another Great Feature', 'tpcore'),
'icon' => 'fa fa-check',
],
[
'text' => __('Obsolete Feature', 'tpcore'),
'icon' => 'fa fa-close',
],
[
'text' => __('Exciting Feature', 'tpcore'),
'icon' => 'fa fa-check',
],
],
'title_field' => '<# print((text)); #>',
]
);
$this->end_controls_section();
// tp_btn_button_group
$this->start_controls_section(
'tp_btn_button_group',
[
'label' => esc_html__('Button', 'tpcore'),
]
);
$this->add_control(
'tp_btn_button_show',
[
'label' => esc_html__( 'Show Button', 'tpcore' ),
'type' => Controls_Manager::SWITCHER,
'label_on' => esc_html__( 'Show', 'tpcore' ),
'label_off' => esc_html__( 'Hide', 'tpcore' ),
'return_value' => 'yes',
'default' => 'yes',
]
);
$this->add_control(
'tp_btn_text',
[
'label' => esc_html__('Button Text', 'tpcore'),
'type' => Controls_Manager::TEXT,
'default' => esc_html__('Button Text', 'tpcore'),
'title' => esc_html__('Enter button text', 'tpcore'),
'label_block' => true,
'condition' => [
'tp_btn_button_show' => 'yes'
],
]
);
$this->add_control(
'tp_btn_link_type',
[
'label' => esc_html__('Button Link Type', 'tpcore'),
'type' => Controls_Manager::SELECT,
'options' => [
'1' => 'Custom Link',
'2' => 'Internal Page',
],
'default' => '1',
'label_block' => true,
'condition' => [
'tp_btn_button_show' => 'yes'
],
]
);
$this->add_control(
'tp_btn_link',
[
'label' => esc_html__('Button link', 'tpcore'),
'type' => Controls_Manager::URL,
'dynamic' => [
'active' => true,
],
'placeholder' => esc_html__('https://your-link.com', 'tpcore'),
'show_external' => false,
'default' => [
'url' => '#',
'is_external' => true,
'nofollow' => true,
'custom_attributes' => '',
],
'condition' => [
'tp_btn_link_type' => '1',
'tp_btn_button_show' => 'yes'
],
'label_block' => true,
]
);
$this->add_control(
'tp_btn_page_link',
[
'label' => esc_html__('Select Button Page', 'tpcore'),
'type' => Controls_Manager::SELECT2,
'label_block' => true,
'options' => tp_get_all_pages(),
'condition' => [
'tp_btn_link_type' => '2',
'tp_btn_button_show' => 'yes'
]
]
);
$this->add_responsive_control(
'tp_align',
[
'label' => esc_html__('Alignment', 'tpcore'),
'type' => Controls_Manager::CHOOSE,
'options' => [
'left' => [
'title' => esc_html__('Left', 'tpcore'),
'icon' => 'eicon-text-align-left',
],
'center' => [
'title' => esc_html__('Center', 'tpcore'),
'icon' => 'eicon-text-align-center',
],
'right' => [
'title' => esc_html__('Right', 'tpcore'),
'icon' => 'eicon-text-align-right',
],
],
'default' => 'left',
'toggle' => false,
'selectors' => [
'{{WRAPPER}}' => 'text-align: {{VALUE}};'
]
]
);
$this->end_controls_section();
// animation
$this->start_controls_section(
'tp_animation_section',
[
'label' => esc_html__('Animation', 'tp-core'),
]
);
// creative animation
$this->add_control(
'tp_creative_anima_switcher',
[
'label' => esc_html__( 'Active Animation', 'tpcore' ),
'type' => \Elementor\Controls_Manager::SWITCHER,
'label_on' => esc_html__( 'Yes', 'tpcore' ),
'label_off' => esc_html__( 'No', 'tpcore' ),
'return_value' => 'yes',
'default' => '0',
'separator' => 'before',
]
);
$this->add_control(
'tp_anima_type',
[
'label' => __( 'Animation Type', 'tpcore' ),
'type' => Controls_Manager::SELECT,
'options' => [
'fadeInUp' => __( 'fadeInUp', 'tpcore' ),
'fadeInDown' => __( 'fadeInDown', 'tpcore' ),
'fadeInLeft' => __( 'fadeInLeft', 'tpcore' ),
'fadeInRight' => __( 'fadeInRight', 'tpcore' ),
],
'default' => 'fadeInUp',
'frontend_available' => true,
'style_transfer' => true,
'condition' => [
'tp_creative_anima_switcher' => 'yes',
],
]
);
$this->add_control(
'tp_anima_dura', [
'label' => esc_html__('Animation Duration', 'tpcore'),
'type' => \Elementor\Controls_Manager::TEXT,
'default' => esc_html__('0.3s', 'tpcore'),
'condition' => [
'tp_creative_anima_switcher' => 'yes',
],
]
);
$this->add_control(
'tp_anima_delay', [
'label' => esc_html__('Animation Delay', 'tpcore'),
'type' => \Elementor\Controls_Manager::TEXT,
'default' => esc_html__('0.6s', 'tpcore'),
'condition' => [
'tp_creative_anima_switcher' => 'yes',
],
]
);
$this->end_controls_section();
// style_tab_content
$this->tp_section_style_controls('pricing_section', 'Section - Style', '.tp-el-section');
$this->tp_basic_style_controls('pricing_title', 'pricing - Title', '.tp-el-title');
$this->tp_basic_style_controls('pricing_price', 'pricing - Price', '.tp-el-price');
$this->tp_icon_style('pricing_icon', 'pricing - Icon/Image/SVG', '.tp-el-price-icon');
$this->tp_basic_style_controls('pricing_list', 'pricing - Features', '.tp-el-list');
$this->tp_link_controls_style('pricing_btn', 'pricing - Button', '.tp-el-btn');
}
private static function get_currency_symbol($symbol_name)
{
$symbols = [
'baht' => '฿',
'bdt' => '৳',
'dollar' => '$',
'euro' => '€',
'franc' => '₣',
'guilder' => 'ƒ',
'indian_rupee' => '₹',
'pound' => '£',
'peso' => '₱',
'peseta' => '₧',
'lira' => '₤',
'ruble' => '₽',
'shekel' => '₪',
'rupee' => '₨',
'real' => 'R$',
'krona' => 'kr',
'won' => '₩',
'yen' => '¥',
];
return isset($symbols[$symbol_name]) ? $symbols[$symbol_name] : '';
}
private static function get_currency_symbol_text($symbol_text)
{
$symbols =[
'baht' => 'THB',
'bdt' => 'BDT',
'dollar' => 'USD',
'euro' => 'EUR',
'franc' => 'EUR',
'guilder' => 'GLD',
'indian_rupee' => 'INR',
'pound' => 'GBP',
'peso' => 'MXN',
'lira' => 'TRY',
'ruble' => 'RUB',
'shekel' => 'ILS',
'real' => 'BRL',
'krona' => 'KR',
'won' => 'KRW',
'yen' => 'JPY',
];
return isset($symbols[$symbol_text]) ? $symbols[$symbol_text] : '';
}
/**
* Render the widget output on the frontend.
*
* Written in PHP and used to generate the final HTML.
*
* @since 1.0.0
*
* @access protected
*/
protected function render() {
$settings = $this->get_settings_for_display();
?>
<?php if ( $settings['tp_design_style'] == 'layout-2' ) :
$this->add_render_attribute('title_args', 'class', 'tp-title');
// Link
if ('2' == $settings['tp_btn_link_type']) {
$this->add_render_attribute('tp-button-arg', 'href', get_permalink($settings['tp_btn_page_link']));
$this->add_render_attribute('tp-button-arg', 'target', '_self');
$this->add_render_attribute('tp-button-arg', 'rel', 'nofollow');
$this->add_render_attribute('tp-button-arg', 'class', 'tp-btn-border-md tp-el-btn');
} else {
if ( ! empty( $settings['tp_btn_link']['url'] ) ) {
$this->add_link_attributes( 'tp-button-arg', $settings['tp_btn_link'] );
$this->add_render_attribute('tp-button-arg', 'class', 'tp-btn-border-md tp-el-btn');
}
}
if ($settings['currency'] === 'custom') {
$currency = $settings['currency_custom'];
} else {
$currency = self::get_currency_symbol($settings['currency']);
}
$item_active = $settings['active_price'] ? 'active' : '';
$item_active_single = $settings['active_price'] ? '<svg width="16" height="13" viewBox="0 0 16 13" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M15.7846 3.2567C15.7846 3.00558 15.6842 2.75446 15.5033 2.57366L14.1373 1.20759C13.9565 1.02679 13.7054 0.926339 13.4542 0.926339C13.2031 0.926339 12.952 1.02679 12.7712 1.20759L6.18192 7.80692L3.22879 4.84375C3.04799 4.66295 2.79688 4.5625 2.54576 4.5625C2.29464 4.5625 2.04353 4.66295 1.86272 4.84375L0.496652 6.20982C0.315848 6.39062 0.215402 6.64174 0.215402 6.89286C0.215402 7.14397 0.315848 7.39509 0.496652 7.57589L4.13281 11.2121L5.49888 12.5781C5.67969 12.7589 5.9308 12.8594 6.18192 12.8594C6.43304 12.8594 6.68415 12.7589 6.86496 12.5781L8.23103 11.2121L15.5033 3.93973C15.6842 3.75893 15.7846 3.50781 15.7846 3.2567Z" fill="currentcolor"></path>
</svg>' : '<svg width="16" height="13" viewBox="0 0 16 13" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M15.7846 3.2567C15.7846 3.00558 15.6842 2.75446 15.5033 2.57366L14.1373 1.20759C13.9565 1.02679 13.7054 0.926339 13.4542 0.926339C13.2031 0.926339 12.952 1.02679 12.7712 1.20759L6.18192 7.80692L3.22879 4.84375C3.04799 4.66295 2.79688 4.5625 2.54576 4.5625C2.29464 4.5625 2.04353 4.66295 1.86272 4.84375L0.496652 6.20982C0.315848 6.39062 0.215402 6.64174 0.215402 6.89286C0.215402 7.14397 0.315848 7.39509 0.496652 7.57589L4.13281 11.2121L5.49888 12.5781C5.67969 12.7589 5.9308 12.8594 6.18192 12.8594C6.43304 12.8594 6.68415 12.7589 6.86496 12.5781L8.23103 11.2121L15.5033 3.93973C15.6842 3.75893 15.7846 3.50781 15.7846 3.2567Z" fill="#336EF9"></path>
</svg>';
?>
<div class="tp-price-2__price-wrap <?php echo esc_attr($item_active); ?> mb-30 wow tpfadeUp" data-wow-duration=".9s" data-wow-delay=".3s" data-background="<?php echo get_template_directory_uri() ?>/assets/img/price/bg-shape.png">
<div class="row">
<div class="col-xl-6 col-lg-12">
<div class="tp-price-2__content-box d-flex align-items-center justify-content-between">
<div class="tp-price-2__content">
<?php if(!empty($settings['tp_features_extra_charge_2'])) :?>
<span><?php echo tp_kses($settings['tp_features_extra_charge_2']); ?> <?php echo esc_html($currency); ?></span>
<?php endif; ?>
<?php if(!empty($settings['title'])) :?>
<h4 class="tp-price-2__title-sm"><?php echo esc_html($settings['title']); ?></h4>
<?php endif; ?>
<?php if(!empty($settings['tp_features_extra_charge'])) :?>
<span><?php echo tp_kses($settings['tp_features_extra_charge']); ?></span>
<?php endif; ?>
</div>
<div class="tp-price-2__icon-box">
<?php if($settings['tp_box_icon_type_2'] == 'icon') : ?>
<?php if (!empty($settings['tp_box_icon_2']) || !empty($settings['tp_box_selected_icon_2']['value'])) : ?>
<span class="mr-35">
<?php tp_render_icon($settings, 'tp_box_icon_2', 'tp_box_selected_icon_2'); ?>
</span>
<?php endif; ?>
<?php elseif( $settings['tp_box_icon_type_2'] == 'image' ) : ?>
<?php if (!empty($settings['tp_box_icon_image_2']['url'])): ?>
<span class="mr-35">
<img src="<?php echo $settings['tp_box_icon_image_2']['url']; ?>" alt="<?php echo get_post_meta(attachment_url_to_postid($settings['tp_box_icon_image_2']['url']), '_wp_attachment_image_alt', true); ?>">
</span>
<?php endif; ?>
<?php else : ?>
<?php if (!empty($settings['tp_box_icon_svg_2'])): ?>
<span class="mr-35">
<?php echo $settings['tp_box_icon_svg_2']; ?>
</span>
<?php endif; ?>
<?php endif; ?>
<span>
<?php if($settings['tp_box_icon_type'] == 'icon') : ?>
<?php if (!empty($settings['tp_box_icon']) || !empty($settings['tp_box_selected_icon']['value'])) : ?>
<span>
<?php tp_render_icon($settings, 'tp_box_icon', 'tp_box_selected_icon'); ?>
</span>
<?php endif; ?>
<?php elseif( $settings['tp_box_icon_type'] == 'image' ) : ?>
<?php if (!empty($settings['tp_box_icon_image']['url'])): ?>
<span>
<img src="<?php echo $settings['tp_box_icon_image']['url']; ?>" alt="<?php echo get_post_meta(attachment_url_to_postid($settings['tp_box_icon_image']['url']), '_wp_attachment_image_alt', true); ?>">
</span>
<?php endif; ?>
<?php else : ?>
<?php if (!empty($settings['tp_box_icon_svg'])): ?>
<span>
<?php echo $settings['tp_box_icon_svg']; ?>
</span>
<?php endif; ?>
<?php endif; ?>
</span>
</div>
</div>
</div>
<div class="col-xl-6 col-lg-12">
<div class="tp-price-2__feature-wrap d-flex align-items-center">
<div class="tp-price-2__feature-list">
<ul>
<?php foreach ($settings['features_list'] as $index => $item) :
$availability = empty($item['tp_feature_unavailable']) ? 'disable' : 'price-available';
?>
<li class="<?php echo esc_attr($availability); ?>">
<span>
<?php echo tp_kses($item_active_single); ?>
</span>
<?php echo tp_kses($item['text']); ?>
</li>
<?php endforeach; ?>
</ul>
</div>
<div class="tp-price-2__btn-box text-center">
<span>
<em><?php echo tp_kses($settings['price']); ?></em>
<i><?php echo esc_html($currency); ?></i>
<?php echo esc_html("/",'tpcore') ?>
<?php if(!empty($settings['month_year'])) :?>
<?php echo tp_kses($settings['month_year']); ?>
<?php endif; ?>
</span>
<?php if (!empty($settings['tp_btn_button_show'])) : ?>
<a <?php echo $this->get_render_attribute_string( 'tp-button-arg' ); ?>><?php echo $settings['tp_btn_text']; ?></a>
<?php endif; ?>
</div>
</div>
</div>
</div>
</div>
<!-- default style -->
<?php else:
$this->add_render_attribute('title_args', 'class', 'tp-title');
// Link
if ('2' == $settings['tp_btn_link_type']) {
$this->add_render_attribute('tp-button-arg', 'href', get_permalink($settings['tp_btn_page_link']));
$this->add_render_attribute('tp-button-arg', 'target', '_self');
$this->add_render_attribute('tp-button-arg', 'rel', 'nofollow');
$this->add_render_attribute('tp-button-arg', 'class', 'tp-price-btn tp-el-btn');
} else {
if ( ! empty( $settings['tp_btn_link']['url'] ) ) {
$this->add_link_attributes( 'tp-button-arg', $settings['tp_btn_link'] );
$this->add_render_attribute('tp-button-arg', 'class', 'tp-price-btn tp-el-btn');
}
}
if ($settings['currency'] === 'custom') {
$currency = $settings['currency_custom'];
} else {
$currency = self::get_currency_symbol($settings['currency']);
}
$item_active = $settings['active_price'] ? 'active' : '';
?>
<div class="tp-price__item <?php echo esc_attr($item_active); ?> p-relative text-center">
<div class="tp-price__head-icon">
<?php if($settings['tp_box_icon_type'] == 'icon') : ?>
<?php if (!empty($settings['tp_box_icon']) || !empty($settings['tp_box_selected_icon']['value'])) : ?>
<span>
<?php tp_render_icon($settings, 'tp_box_icon', 'tp_box_selected_icon'); ?>
</span>
<?php endif; ?>
<?php elseif( $settings['tp_box_icon_type'] == 'image' ) : ?>
<?php if (!empty($settings['tp_box_icon_image']['url'])): ?>
<span>
<img src="<?php echo $settings['tp_box_icon_image']['url']; ?>" alt="<?php echo get_post_meta(attachment_url_to_postid($settings['tp_box_icon_image']['url']), '_wp_attachment_image_alt', true); ?>">
</span>
<?php endif; ?>
<?php else : ?>
<?php if (!empty($settings['tp_box_icon_svg'])): ?>
<span>
<?php echo $settings['tp_box_icon_svg']; ?>
</span>
<?php endif; ?>
<?php endif; ?>
</div>
<?php if(!empty($settings['title'])) :?>
<div class="tp-price__head">
<h4 class="tp-price__title"><?php echo esc_html($settings['title']); ?></h4>
<?php if(!empty($settings['sub_title'])) :?>
<span><?php echo esc_html($settings['sub_title']); ?></span>
<?php endif; ?>
</div>
<?php endif; ?>
<div class="tp-price__mpbs tp-price__mpbs-bg <?php echo esc_attr($item_active); ?>"
data-background="<?php echo get_template_directory_uri() ?>/assets/img/price/price-bg-shape.png">
<?php if(!empty($settings['secondary_title'])) :?>
<h4><?php echo tp_kses($settings['secondary_title']); ?></h4>
<?php endif; ?>
<?php if(!empty($settings['secondary_sub_title'])) :?>
<span><?php echo esc_html($settings['secondary_sub_title']); ?></span>
<?php endif; ?>
</div>
<div class="tp-price__content-wrap">
<div class="tp-price__feature">
<ul>
<?php foreach ($settings['features_list'] as $index => $item) :
$availability = empty($item['tp_feature_unavailable']) ? 'disable' : 'price-available';
?>
<li class="<?php echo esc_attr($availability); ?>"><?php echo tp_kses($item['text']); ?></li>
<?php endforeach; ?>
</ul>
</div>
<div class="tp-price__info-box">
<h4 class="p-relative">
<?php echo tp_kses($settings['price']); ?> <?php echo esc_html($currency); ?><?php echo esc_html("/",'tpcore') ?>
<?php if(!empty($settings['month_year'])) :?>
<?php echo tp_kses($settings['month_year']); ?>
<?php endif; ?>
<span>
<svg width="115" height="4" viewBox="0 0 115 4" fill="none"
xmlns="http://www.w3.org/2000/svg">
<path
d="M0.717253 3.37845C38.4419 2.0427 75.95 1.8304 113.648 3.99767C114.966 4.07729 114.948 2.08693 113.648 1.98963C76.1937 -0.770334 38.0899 -0.849948 0.717253 2.96269C0.446437 2.98923 0.43741 3.3873 0.717253 3.37845Z"
fill="#FFB302" />
</svg>
</span>
</h4>
<?php if(!empty($settings['tp_features_extra_charge'])) :?>
<span><?php echo tp_kses($settings['tp_features_extra_charge']); ?></span>
<?php endif; ?>
<?php if(!empty($settings['tp_features_extra_charge_2'])) :?>
<span><?php echo tp_kses($settings['tp_features_extra_charge_2']); ?> <?php echo esc_html($currency); ?></span>
<?php endif; ?>
</div>
<?php if (!empty($settings['tp_btn_button_show'])) : ?>
<div class="tp-price__btn-box">
<a <?php echo $this->get_render_attribute_string( 'tp-button-arg' ); ?>><?php echo $settings['tp_btn_text']; ?><span></span></a>
</div>
<?php endif; ?>
</div>
</div>
<?php endif;
}
}
$widgets_manager->register( new TP_Pricing() );