navasena/wp-content/plugins/thinkai-plugin/elementor/pricing_plan.php

1104 lines
36 KiB
PHP
Raw Permalink Normal View History

2024-07-31 13:12:38 +07:00
<?php
namespace THINKAIPLUGIN\Element;
use Elementor\Controls_Manager;
use Elementor\Controls_Stack;
use Elementor\Group_Control_Typography;
use Elementor\Group_Control_Border;
use Elementor\Repeater;
use Elementor\Widget_Base;
use Elementor\Utils;
use Elementor\Group_Control_Text_Shadow;
use \Elementor\Group_Control_Box_Shadow;
use \Elementor\Group_Control_Background;
use \Elementor\Group_Control_Image_Size;
use Elementor\Plugin;
/**
* Elementor button widget.
* Elementor widget that displays a button with the ability to control every
* aspect of the button design.
*
* @since 1.0.0
*/
class Pricing_Plan extends Widget_Base
{
/**
* Get widget name.
* Retrieve button widget name.
*
* @since 1.0.0
* @access public
* @return string Widget name.
*/
public function get_name()
{
return 'thinkai_pricing_plan';
}
/**
* Get widget title.
* Retrieve button widget title.
*
* @since 1.0.0
* @access public
* @return string Widget title.
*/
public function get_title()
{
return esc_html__('Thinkai Pricing Plan', 'thinkai');
}
/**
* Get widget icon.
* Retrieve button widget icon.
*
* @since 1.0.0
* @access public
* @return string Widget icon.
*/
public function get_icon()
{
return 'eicon-library-open';
}
/**
* Get widget categories.
* Retrieve the list of categories the button widget belongs to.
* Used to determine where to display the widget in the editor.
*
* @since 2.0.0
* @access public
* @return array Widget categories.
*/
public function get_categories()
{
return [ 'thinkai' ];
}
public function get_script_depends() {
wp_register_script( 'tabs-script', YT_URL . 'assets/js/pricing-tabs.js', [ 'elementor-frontend' ], '1.0.0', true );
return [ 'tabs-script' ];
}
/**
* Register button 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(
'monthly_table',
[
'label' => esc_html__( 'Monthly Table', 'thinkai' ),
'tab' => Controls_Manager::TAB_LAYOUT,
]
);
//Layout
$this->add_control(
'layout_control',
[
'label' => esc_html__( 'Layout Style', 'thinkai' ),
'label_block' => true,
'type' => Controls_Manager::SELECT,
'default' => '1',
'options' => array(
'1' => esc_html__( 'Style One ', 'thinkai'),
'2' => esc_html__( 'Style Two ', 'thinkai'),
'3' => esc_html__( 'Style Three ', 'thinkai'),
),
]
);
//Show Shape Image
$this->add_control(
'show_shape_image',
[
'label' => esc_html__( 'Enable Shape Image', 'thinkai' ),
'type' => Controls_Manager::SWITCHER,
'label_on' => esc_html__( 'On', 'thinkai' ),
'label_off' => esc_html__( 'Off', 'thinkai' ),
'return_value' => 'yes',
'default' => 'no',
'condition' => [
'layout_control' => ['2','3'],
],
]
);
//Shape img V1
$this->add_control(
'shape_image_v1',
[
'label' => __( 'Shape Image V1', 'thinkai' ),
'type' => Controls_Manager::MEDIA,
'default' => ['url' => Utils::get_placeholder_image_src(),],
'condition' => [
'layout_control' => ['2','3'],
'show_shape_image' => 'yes'
],
]
);
//Shape img V1
$this->add_control(
'shape_image_v2',
[
'label' => __( 'Shape Image V2', 'thinkai' ),
'type' => Controls_Manager::MEDIA,
'default' => ['url' => Utils::get_placeholder_image_src(),],
'condition' => [
'layout_control' => ['2','3'],
'show_shape_image' => 'yes'
],
]
);
$this->add_control(
'monthly_btn_title',
[
'label' => __('Monthly Button Title', 'thinkai'),
'label_block' => true,
'type' => Controls_Manager::TEXT,
'dynamic' => [
'active' => true,
],
'default' => esc_html__('Bill Monthly', 'thinkai'),
'condition' => [
'layout_control' => ['1','2'],
],
]
);
//Monthly Plan Table
$repeater = new Repeater();
$repeater->add_control(
'icon',
[
'label' => esc_html__('Enter The icons', 'thinkai'),
'type' => \Elementor\Controls_Manager::ICONS,
'default' => [
'value' => 'icon-input',
'library' => 'solid',
],
]
);
$repeater->add_control(
'plan_title',
[
'label' => __( 'Plan Title', 'thinkai' ),
'type' => Controls_Manager::TEXT,
'label_block' => true,
'dynamic' => [
'active' => true,
],
'placeholder' => __( 'Enter your Plan Title', 'thinkai' ),
]
);
$repeater->add_control(
'plan_text',
[
'label' => __( 'Plan Description', 'thinkai' ),
'type' => Controls_Manager::TEXTAREA,
'label_block' => true,
'dynamic' => [
'active' => true,
],
'placeholder' => __( 'Enter your Plan Description', 'thinkai' ),
]
);
$repeater->add_control(
'currency_sing',
[
'label' => __( 'Currency Symbols', 'thinkai' ),
'type' => Controls_Manager::TEXT,
'label_block' => true,
'dynamic' => [
'active' => true,
],
'placeholder' => __( 'Enter Your Currency Symbols', 'thinkai' ),
]
);
$repeater->add_control(
'price',
[
'label' => __( 'Price', 'thinkai' ),
'type' => Controls_Manager::TEXT,
'label_block' => true,
'dynamic' => [
'active' => true,
],
'placeholder' => __( 'Enter your Title', 'thinkai' ),
]
);
$repeater->add_control(
'duration',
[
'label' => __( 'Duration', 'thinkai' ),
'type' => Controls_Manager::TEXT,
'label_block' => true,
'dynamic' => [
'active' => true,
],
'placeholder' => __( 'Enter your Duration', 'thinkai' ),
]
);
$repeater->add_control(
'features_list',
[
'label' => __( 'Feature List', 'thinkai' ),
'type' => Controls_Manager::TEXTAREA,
'label_block' => true,
'dynamic' => [
'active' => true,
],
'placeholder' => __( 'Enter your Feature List', 'thinkai' ),
]
);
$repeater->add_control(
'btn_title',
[
'label' => __( 'Button Title', 'thinkai' ),
'type' => Controls_Manager::TEXT,
'label_block' => true,
'dynamic' => [
'active' => true,
],
'placeholder' => __( 'Enter your Button Title', 'thinkai' ),
]
);
$repeater->add_control(
'link_option',
[
'label' => esc_html__( 'Select link Option', 'thinkai' ),
'label_block' => true,
'type' => Controls_Manager::SELECT,
'default' => 'extranal',
'options' => array(
'extranal' => esc_html__( 'Extranal ', 'thinkai'),
'page' => esc_html__( 'Page ', 'thinkai'),
),
]
);
$repeater->add_control(
'link',
[
'label' => __( 'External Link', 'thinkai' ),
'type' => Controls_Manager::URL,
'label_block' => true,
'placeholder' => __( 'https://your-link.com', 'thinkai' ),
'show_external' => true,
'default' => [
'url' => '',
'is_external' => true,
'nofollow' => true,
],
'condition' => [
'link_option' => 'extranal'
]
]
);
$repeater->add_control(
'page_select',
[
'label' => esc_html__( 'Select Page', 'thinkai' ),
'label_block' => true,
'type' => Controls_Manager::SELECT2,
'default' => 'extranal',
'options' => thinkai_page_list(),
'condition' => [
'link_option' => 'page'
]
]
);
$this->add_control(
'monthly',
[
'label' => __('Add Monthly Plan', 'thinkai'),
'type' => Controls_Manager::REPEATER,
'fields' => $repeater->get_controls(),
'title_field' => '{{{ plan_title }}}',
'condition' => [
'layout_control' => ['1','2'],
],
]
);
$this->end_controls_section();
$this->start_controls_section(
'yearly_table',
[
'label' => esc_html__( 'Yearly Table', 'thinkai' ),
'tab' => Controls_Manager::TAB_LAYOUT,
'condition' => [
'layout_control' => ['1','2'],
],
]
);
$this->add_control(
'yearly_btn_title',
[
'label' => __('Yearly Button Title', 'thinkai'),
'label_block' => true,
'type' => Controls_Manager::TEXT,
'dynamic' => [
'active' => true,
],
'default' => esc_html__('Bill Yearly', 'thinkai'),
]
);
//Yearly Plan Table
$repeater = new Repeater();
$repeater->add_control(
'icon_v2',
[
'label' => esc_html__('Enter The icons', 'thinkai'),
'type' => \Elementor\Controls_Manager::ICONS,
'default' => [
'value' => 'icon-input',
'library' => 'solid',
],
]
);
$repeater->add_control(
'plan_title_v2',
[
'label' => __( 'Plan Title', 'thinkai' ),
'type' => Controls_Manager::TEXT,
'label_block' => true,
'dynamic' => [
'active' => true,
],
'placeholder' => __( 'Enter your Plan Title', 'thinkai' ),
]
);
$repeater->add_control(
'plan_text_v2',
[
'label' => __( 'Plan Description', 'thinkai' ),
'type' => Controls_Manager::TEXTAREA,
'label_block' => true,
'dynamic' => [
'active' => true,
],
'placeholder' => __( 'Enter your Plan Description', 'thinkai' ),
]
);
$repeater->add_control(
'currency_sing_v2',
[
'label' => __( 'Currency Symbols', 'thinkai' ),
'type' => Controls_Manager::TEXT,
'label_block' => true,
'dynamic' => [
'active' => true,
],
'placeholder' => __( 'Enter Your Currency Symbols', 'thinkai' ),
]
);
$repeater->add_control(
'price_v2',
[
'label' => __( 'Price', 'thinkai' ),
'type' => Controls_Manager::TEXT,
'label_block' => true,
'dynamic' => [
'active' => true,
],
'placeholder' => __( 'Enter your Title', 'thinkai' ),
]
);
$repeater->add_control(
'duration_v2',
[
'label' => __( 'Duration', 'thinkai' ),
'type' => Controls_Manager::TEXT,
'label_block' => true,
'dynamic' => [
'active' => true,
],
'placeholder' => __( 'Enter your Duration', 'thinkai' ),
]
);
$repeater->add_control(
'features_list_v2',
[
'label' => __( 'Feature List', 'thinkai' ),
'type' => Controls_Manager::TEXTAREA,
'label_block' => true,
'dynamic' => [
'active' => true,
],
'placeholder' => __( 'Enter your Feature List', 'thinkai' ),
]
);
$repeater->add_control(
'btn_title_v2',
[
'label' => __( 'Button Title', 'thinkai' ),
'type' => Controls_Manager::TEXT,
'label_block' => true,
'dynamic' => [
'active' => true,
],
'placeholder' => __( 'Enter your Button Title', 'thinkai' ),
]
);
$repeater->add_control(
'link_option_v2',
[
'label' => esc_html__( 'Select link Option', 'thinkai' ),
'label_block' => true,
'type' => Controls_Manager::SELECT,
'default' => 'extranal',
'options' => array(
'extranal_v2' => esc_html__( 'Extranal ', 'thinkai'),
'page_v2' => esc_html__( 'Page ', 'thinkai'),
),
]
);
$repeater->add_control(
'link_v2',
[
'label' => __( 'External Link', 'thinkai' ),
'type' => Controls_Manager::URL,
'label_block' => true,
'placeholder' => __( 'https://your-link.com', 'thinkai' ),
'show_external' => true,
'default' => [
'url' => '',
'is_external' => true,
'nofollow' => true,
],
'condition' => [
'link_option_v2' => 'extranal_v2'
]
]
);
$repeater->add_control(
'page_select_v2',
[
'label' => esc_html__( 'Select Page', 'thinkai' ),
'label_block' => true,
'type' => Controls_Manager::SELECT2,
'default' => 'extranal',
'options' => thinkai_page_list(),
'condition' => [
'link_option_v2' => 'page_v2'
]
]
);
$this->add_control(
'yearly',
[
'label' => __('Add Yearly Plan', 'thinkai'),
'type' => Controls_Manager::REPEATER,
'fields' => $repeater->get_controls(),
'title_field' => '{{{ plan_title_v2 }}}',
]
);
$this->end_controls_section();
$this->start_controls_section(
'monthly_yearly_table',
[
'label' => esc_html__( 'Monthly/Yearly Table', 'thinkai' ),
'tab' => Controls_Manager::TAB_LAYOUT,
'condition' => [
'layout_control' => ['3'],
],
]
);
//Yearly Plan Table
$repeater = new Repeater();
$repeater->add_control(
'tab_btn_title',
[
'label' => __('Tab Button Title', 'thinkai'),
'label_block' => true,
'type' => Controls_Manager::TEXT,
'dynamic' => [
'active' => true,
],
'default' => esc_html__('Bill Monthly', 'thinkai'),
]
);
$repeater->add_control(
'popular_tag_title',
[
'label' => __( 'Popular Tag Title', 'thinkai' ),
'type' => Controls_Manager::TEXT,
'label_block' => true,
'dynamic' => [
'active' => true,
],
'placeholder' => __( 'Enter your Popular Tag Title', 'thinkai' ),
]
);
$repeater->add_control(
'title',
[
'label' => __( 'Title', 'thinkai' ),
'type' => Controls_Manager::TEXT,
'label_block' => true,
'dynamic' => [
'active' => true,
],
'placeholder' => __( 'Enter your Title', 'thinkai' ),
]
);
$repeater->add_control(
'plan_title',
[
'label' => __( 'Plan Title', 'thinkai' ),
'type' => Controls_Manager::TEXT,
'label_block' => true,
'dynamic' => [
'active' => true,
],
'placeholder' => __( 'Enter your Plan Title', 'thinkai' ),
]
);
$repeater->add_control(
'plan_text',
[
'label' => __( 'Plan Description', 'thinkai' ),
'type' => Controls_Manager::TEXTAREA,
'label_block' => true,
'dynamic' => [
'active' => true,
],
'placeholder' => __( 'Enter your Plan Description', 'thinkai' ),
]
);
$repeater->add_control(
'list_title_v1',
[
'label' => __( 'List Title V1', 'thinkai' ),
'type' => Controls_Manager::TEXT,
'label_block' => true,
'dynamic' => [
'active' => true,
],
'placeholder' => __( 'Enter your List Title', 'thinkai' ),
]
);
$repeater->add_control(
'list_text_v1',
[
'label' => __( 'List Text V1', 'thinkai' ),
'type' => Controls_Manager::TEXT,
'label_block' => true,
'dynamic' => [
'active' => true,
],
'placeholder' => __( 'Enter your Text Title', 'thinkai' ),
]
);
$repeater->add_control(
'list_title_v2',
[
'label' => __( 'List Title V2', 'thinkai' ),
'type' => Controls_Manager::TEXT,
'label_block' => true,
'dynamic' => [
'active' => true,
],
'placeholder' => __( 'Enter your List Title', 'thinkai' ),
]
);
$repeater->add_control(
'list_text_v2',
[
'label' => __( 'List Text V2', 'thinkai' ),
'type' => Controls_Manager::TEXT,
'label_block' => true,
'dynamic' => [
'active' => true,
],
'placeholder' => __( 'Enter your Text Title', 'thinkai' ),
]
);
$repeater->add_control(
'inqueries_title',
[
'label' => __( 'Inqueries Title', 'thinkai' ),
'type' => Controls_Manager::TEXT,
'label_block' => true,
'dynamic' => [
'active' => true,
],
'placeholder' => __( 'Enter your Inqueries Title', 'thinkai' ),
]
);
$repeater->add_control(
'inqueries_link',
[
'label' => __( 'External Link', 'thinkai' ),
'type' => Controls_Manager::URL,
'label_block' => true,
'placeholder' => __( 'https://your-link.com', 'thinkai' ),
'show_external' => true,
'default' => [
'url' => '',
'is_external' => true,
'nofollow' => true,
],
]
);
$repeater->add_control(
'icon',
[
'label' => esc_html__('Enter The icons', 'thinkai'),
'type' => \Elementor\Controls_Manager::ICONS,
'default' => [
'value' => 'icon-geometric',
'library' => 'solid',
],
]
);
$repeater->add_control(
'price',
[
'label' => __( 'Price', 'thinkai' ),
'type' => Controls_Manager::TEXT,
'label_block' => true,
'dynamic' => [
'active' => true,
],
'placeholder' => __( 'Enter your Price', 'thinkai' ),
]
);
$repeater->add_control(
'space_title',
[
'label' => __( 'Total Space', 'thinkai' ),
'type' => Controls_Manager::TEXT,
'label_block' => true,
'dynamic' => [
'active' => true,
],
'placeholder' => __( 'Enter your Total Space', 'thinkai' ),
]
);
$repeater->add_control(
'features_list',
[
'label' => __( 'Feature List', 'thinkai' ),
'type' => Controls_Manager::TEXTAREA,
'label_block' => true,
'dynamic' => [
'active' => true,
],
'placeholder' => __( 'Enter your Feature List', 'thinkai' ),
]
);
$repeater->add_control(
'btn_title',
[
'label' => __( 'Button Title', 'thinkai' ),
'type' => Controls_Manager::TEXT,
'label_block' => true,
'dynamic' => [
'active' => true,
],
'placeholder' => __( 'Enter your Button Title', 'thinkai' ),
]
);
$repeater->add_control(
'link_option',
[
'label' => esc_html__( 'Select link Option', 'thinkai' ),
'label_block' => true,
'type' => Controls_Manager::SELECT,
'default' => 'extranal',
'options' => array(
'extranal' => esc_html__( 'Extranal ', 'thinkai'),
'page' => esc_html__( 'Page ', 'thinkai'),
),
]
);
$repeater->add_control(
'link',
[
'label' => __( 'External Link', 'thinkai' ),
'type' => Controls_Manager::URL,
'label_block' => true,
'placeholder' => __( 'https://your-link.com', 'thinkai' ),
'show_external' => true,
'default' => [
'url' => '',
'is_external' => true,
'nofollow' => true,
],
'condition' => [
'link_option' => 'extranal'
]
]
);
$repeater->add_control(
'page_select',
[
'label' => esc_html__( 'Select Page', 'thinkai' ),
'label_block' => true,
'type' => Controls_Manager::SELECT2,
'default' => 'extranal',
'options' => thinkai_page_list(),
'condition' => [
'link_option' => 'page'
]
]
);
$this->add_control(
'pricing_table',
[
'label' => __('Add Pricing Plan', 'thinkai'),
'type' => Controls_Manager::REPEATER,
'fields' => $repeater->get_controls(),
'title_field' => '{{{ plan_title }}}',
]
);
$this->end_controls_section();
}
/**
* Render button 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();
$allowed_tags = wp_kses_allowed_html('post');
$layout = $settings[ 'layout_control' ];
?>
<?php if( $layout === '3' ): ?>
<!--Start Pricing Page One-->
<section class="pricing-page-one">
<?php if($settings['show_shape_image'] == 'yes' ){ ?>
<div class="shape1"><img src="<?php echo esc_url(wp_get_attachment_url($settings['shape_image_v1']['id'])); ?>" alt="<?php bloginfo( 'name' ); ?>"></div>
<div class="shape2"><img src="<?php echo esc_url(wp_get_attachment_url($settings['shape_image_v2']['id'])); ?>" alt="<?php bloginfo( 'name' ); ?>"></div>
<?php } ?>
<div class="container">
<div class="pricing-page-one__content switcher-tabs-box">
<div class="tab-btn-box-style2">
<ul class="tab-btns tab-buttons clearfix">
<?php
foreach ($settings['pricing_table'] as $key => $item):
?>
<li class="tab-btn <?php if($key == 0) echo 'active-btn'; ?>" data-tab="#tab-1<?php echo esc_attr($key); ?>"><?php echo wp_kses($item['tab_btn_title'], true); ?></li>
<?php endforeach; ?>
</ul>
</div>
<div class="tabs-content">
<?php
foreach ($settings['pricing_table'] as $key => $item):
$icon = $item['icon'];
$page = $item['link_option'];
$page_select = $item[ 'page_select' ];
$ext_url = $item[ 'link' ];
if( $page == 'page' ){
$mount_link = get_page_link( $page_select );
}else{
$mount_link = $ext_url['url'];
$target = $ext_url['is_external'] ? ' target="_blank"' : '';
$nofollow = $ext_url['nofollow'] ? ' rel="nofollow"' : '';
}
?>
<div class="tab <?php if($key == 0) echo 'active-tab'; ?>" id="tab-1<?php echo esc_attr($key); ?>">
<div class="single-pricing-style2">
<?php if($item['popular_tag_title']){ ?>
<div class="popular-text">
<?php echo wp_kses($item['popular_tag_title'], true); ?>
</div>
<?php } ?>
<div class="row">
<div class="col-xl-6 col-lg-6 col-md-6">
<div class="single-pricing-style2__left">
<div class="inner-title">
<h3><?php echo wp_kses($item['title'], true); ?></h3>
</div>
<h4><?php echo wp_kses($item['plan_title'], true); ?><span class="icon-right-arrow1"></span></h4>
<p><?php echo wp_kses($item['plan_text'], true); ?></p>
<ul>
<li>
<h4><?php echo wp_kses($item['list_title_v1'], true); ?></h4>
<p><?php echo wp_kses($item['list_text_v1'], true); ?></p>
</li>
<li>
<h4><?php echo wp_kses($item['list_title_v2'], true); ?></h4>
<p><?php echo wp_kses($item['list_text_v2'], true); ?></p>
</li>
</ul>
<div class="bottom-box">
<h3><?php echo wp_kses($item['inqueries_title'], true); ?></h3>
<a href="<?php echo esc_url($item['inqueries_link']['url']); ?>"><span class="icon-right-arrow1"></span></a>
</div>
</div>
</div>
<div class="col-xl-6 col-lg-6 col-md-6">
<div class="single-pricing-style2__right">
<div class="inner-title">
<div class="left">
<?php if($icon){ ?>
<?php
$icon = str_replace( "icon ", "", $item['icon']);
if( !empty( $icon ) ):?>
<?php \Elementor\Icons_Manager::render_icon( $icon ); ?>
<?php else:?>
<span class="icon-geometric"></span>
<?php endif;?>
<?php } ?>
<h2><?php echo wp_kses($item['price'], true); ?></h2>
</div>
<div class="right"><?php echo wp_kses($item['space_title'], true); ?></div>
</div>
<?php
$features_list = $item['features_list'];
if(!empty($features_list)){
$features_list = explode("\n", ($features_list));
?>
<ul>
<?php foreach($features_list as $features): ?>
<li>
<?php echo wp_kses($features, true); ?>
<span class="icon-correct-1"></span>
</li>
<?php endforeach; ?>
</ul>
<?php } ?>
<?php if($item['btn_title']){ ?>
<div class="btn-box">
<a class="btn-one" href="<?php echo esc_url( $mount_link );?>" <?php if( $page == 'extranal' ) echo esc_attr( $target );?> <?php if( $page == 'extranal' ) echo esc_attr( $nofollow );?>>
<span class="txt"><?php echo wp_kses($item['btn_title'], true);?></span>
</a>
</div>
<?php } ?>
</div>
</div>
</div>
</div>
</div>
<?php endforeach; ?>
</div>
</div>
</div>
</section>
<!--End Pricing Page One-->
<?php else: ?>
<!-- Start Pricing Style1 -->
<section class=" p-0 m-0 <?php if($settings[ 'layout_control' ] == '2') echo 'pricing-page-two'; else echo 'pricing-style1'; ?>">
<?php if($settings['show_shape_image'] == 'yes' ){ ?>
<div class="shape1"><img src="<?php echo esc_url(wp_get_attachment_url($settings['shape_image_v1']['id'])); ?>" alt="<?php bloginfo( 'name' ); ?>"></div>
<div class="shape2"><img src="<?php echo esc_url(wp_get_attachment_url($settings['shape_image_v2']['id'])); ?>" alt="<?php bloginfo( 'name' ); ?>"></div>
<?php } ?>
<div class="container">
<div class="pricing-style1__switch-toggle">
<ul class="switch-toggler-list" role="tablist" id="switch-toggle-tab">
<li class="month active">
<a href="#"><?php echo wp_kses($settings['monthly_btn_title'], true); ?></a>
</li>
<li>
<label class="switch on">
<span class="slider round"></span>
</label>
</li>
<li class="year">
<a href="#"><?php echo wp_kses($settings['yearly_btn_title'], true); ?></a>
</li>
</ul>
</div>
<div class="tabed-content">
<div id="month">
<div class="row">
<?php
foreach ($settings['monthly'] as $key => $item):
$icon = $item['icon'];
$page = $item['link_option'];
$page_select = $item[ 'page_select' ];
$ext_url = $item[ 'link' ];
if( $page == 'page' ){
$mount_link = get_page_link( $page_select );
}else{
$mount_link = $ext_url['url'];
$target = $ext_url['is_external'] ? ' target="_blank"' : '';
$nofollow = $ext_url['nofollow'] ? ' rel="nofollow"' : '';
}
?>
<!-- Start pricing Style1 single -->
<div class="col-xl-4 col-lg-4 col-lg-4 animated fadeInLeft">
<div class="pricing-style1__single">
<?php if($icon){ ?>
<div class="pricing-style1__single-icon">
<?php
$icon = str_replace( "icon ", "", $item['icon']);
if( !empty( $icon ) ):?>
<?php \Elementor\Icons_Manager::render_icon( $icon ); ?>
<?php else:?>
<span class="icon-geometric"></span>
<?php endif;?>
</div>
<?php } ?>
<div class="pricing-style1__single-title">
<h3><?php echo wp_kses($item['plan_title'], true); ?></h3>
<p><?php echo wp_kses($item['plan_text'], true); ?></p>
</div>
<div class="pricing-style1__single-value">
<h2>
<?php if($item['currency_sing']){ ?><sup><?php echo wp_kses($item['currency_sing'], true); ?></sup><?php } ?>
<?php echo wp_kses($item['price'], true); ?>
<?php if($item['duration']){ ?>
<sub>
<span>.00</span> / <?php echo wp_kses($item['duration'], true); ?>
</sub>
<?php } ?>
</h2>
</div>
<?php
$features_list = $item['features_list'];
if(!empty($features_list)){
$features_list = explode("\n", ($features_list));
?>
<ul class="pricing-style1__single-list">
<?php foreach($features_list as $features): ?>
<li>
<p><?php echo wp_kses($features, true); ?></p>
<span class="icon-correct-1"></span>
</li>
<?php endforeach; ?>
</ul>
<?php } ?>
<?php if($item['btn_title']){ ?>
<div class="pricing-style1__single-btn-box">
<a class="btn-one" href="<?php echo esc_url( $mount_link );?>" <?php if( $page == 'extranal' ) echo esc_attr( $target );?> <?php if( $page == 'extranal' ) echo esc_attr( $nofollow );?>>
<span class="txt"><?php echo wp_kses($item['btn_title'], true);?></span>
</a>
</div>
<?php } ?>
</div>
</div>
<!-- End pricing Style1 single -->
<?php endforeach; ?>
</div>
</div>
<div id="year">
<div class="row">
<?php
foreach ($settings['yearly'] as $key => $item):
$icon_v2 = $item['icon_v2'];
$page_v2 = $item['link_option_v2'];
$page_select_v2 = $item[ 'page_select_v2' ];
$ext_url_v2 = $item[ 'link_v2' ];
if( $page_v2 == 'page_v2' ){
$mount_link_v2 = get_page_link( $page_select_v2 );
}else{
$mount_link_v2 = $ext_url_v2['url'];
$target_v2 = $ext_url_v2['is_external'] ? ' target="_blank"' : '';
$nofollow_v2 = $ext_url_v2['nofollow'] ? ' rel="nofollow"' : '';
}
?>
<!-- Start pricing Style1 single -->
<div class="col-xl-4 col-lg-4 col-lg-4 animated fadeInRight">
<div class="pricing-style1__single">
<?php if($icon_v2){ ?>
<div class="pricing-style1__single-icon">
<?php
$icon = str_replace( "icon ", "", $item['icon_v2']);
if( !empty( $icon_v2 ) ):?>
<?php \Elementor\Icons_Manager::render_icon( $icon_v2 ); ?>
<?php else:?>
<span class="icon-geometric"></span>
<?php endif;?>
</div>
<?php } ?>
<div class="pricing-style1__single-title">
<h3><?php echo wp_kses($item['plan_title_v2'], true); ?></h3>
<p><?php echo wp_kses($item['plan_text_v2'], true); ?></p>
</div>
<div class="pricing-style1__single-value">
<h2>
<?php if($item['currency_sing_v2']){ ?><sup><?php echo wp_kses($item['currency_sing_v2'], true); ?></sup><?php } ?>
<?php echo wp_kses($item['price_v2'], true); ?>
<?php if($item['duration_v2']){ ?>
<sub>
<span>.00</span> / <?php echo wp_kses($item['duration_v2'], true); ?>
</sub>
<?php } ?>
</h2>
</div>
<?php
$features_list = $item['features_list_v2'];
if(!empty($features_list)){
$features_list = explode("\n", ($features_list));
?>
<ul class="pricing-style1__single-list">
<?php foreach($features_list as $features): ?>
<li>
<p><?php echo wp_kses($features, true); ?></p>
<span class="icon-correct-1"></span>
</li>
<?php endforeach; ?>
</ul>
<?php } ?>
<?php if($item['btn_title_v2']){ ?>
<div class="pricing-style1__single-btn-box">
<a class="btn-one" href="<?php echo esc_url( $mount_link_v2 );?>" <?php if( $page_v2 == 'extranal' ) echo esc_attr( $target_v2 );?> <?php if( $page_v2 == 'extranal' ) echo esc_attr( $nofollow_v2 );?>>
<span class="txt"><?php echo wp_kses($item['btn_title_v2'], true);?></span>
</a>
</div>
<?php } ?>
</div>
</div>
<!-- End pricing Style1 single -->
<?php endforeach; ?>
</div>
</div>
</div>
</div>
</section>
<!-- End Pricing Style1 -->
<?php endif;
}
}