PATH:
home
/
lab2454c
/
mact34.com
/
wp-content
/
plugins
/
tryo-toolkit
/
widgets
<?php /** * Pricing Widget */ namespace Elementor; class Tryo_Pricing extends Widget_Base { public function get_name() { return 'Tryo_Pricing'; } public function get_title() { return __( 'Pricing Card', 'tryo-toolkit' ); } public function get_icon() { return 'eicon-price-list'; } public function get_categories() { return [ 'tryo-elements' ]; } protected function _register_controls() { $this->start_controls_section( 'Tryo_Pricing', [ 'label' => __( 'Tryo Pricing', 'tryo-toolkit' ), 'tab' => Controls_Manager::TAB_CONTENT, ] ); $this->add_control( 'card_active', [ 'label' => __( 'Active', 'tryo' ), 'type' => Controls_Manager::SWITCHER, 'label_on' => __( 'Yes', 'tryo' ), 'label_off' => __( 'No', 'tryo' ), 'return_value' => 'yes', 'default' => 'no', ] ); $this->add_control( 'title', [ 'label' => __( 'Title', 'tryo-toolkit' ), 'type' => Controls_Manager::TEXT, 'default' => __('Basic', 'tryo-toolkit'), ] ); $this->add_control( 'short_desc', [ 'label' => __( 'Short Description', 'tryo-toolkit' ), 'type' => Controls_Manager::TEXT, 'default' => __('Get your business up and running', 'tryo-toolkit'), ] ); $this->add_control( 'currency_symbol', [ 'label' => __( 'Currency Symbol', 'tryo-toolkit' ), 'type' => Controls_Manager::TEXT, 'default' => __('$', 'tryo-toolkit'), ] ); $this->add_control( 'price', [ 'label' => __( 'Price', 'tryo-toolkit' ), 'type' => Controls_Manager::TEXT, 'default' => __('0', 'tryo-toolkit'), ] ); $this->add_control( 'period', [ 'label' => __( 'Period', 'tryo-toolkit' ), 'type' => Controls_Manager::TEXT, 'default' => __('/m', 'tryo-toolkit'), ] ); $this->add_control( 'button_text', [ 'label' => __( 'Button Text', 'tryo-toolkit' ), 'type' => Controls_Manager::TEXT, 'default' => __('Choose this plan', 'tryo-toolkit'), ] ); $this->add_control( 'button_link', [ 'label' => __( 'Button Link', 'tryo-toolkit' ), 'type' => Controls_Manager::URL, ] ); $this->add_control( 'features', [ 'label' => esc_html__('Features', 'tryo-toolkit'), 'type' => Controls_Manager::REPEATER, 'separator' => 'before', 'fields' => [ [ 'name' => 'icon', 'label' => __( 'Icon', 'tryo-toolkit' ), 'type' => Controls_Manager::ICON, 'default' => 'fa fa-check', ], [ 'name' => 'text', 'label' => __( 'Text', 'tryo-toolkit' ), 'type' => Controls_Manager::TEXT, 'default' => __('100 outgoing transfers/mo', 'tryo-toolkit'), ], ], ] ); $this->end_controls_section(); $this->start_controls_section( 'price_style', [ 'label' => __( 'Style', 'tryo-toolkit' ), 'tab' => Controls_Manager::TAB_STYLE, ] ); $this->add_control( 'title_color', [ 'label' => __( 'Title Color', 'tryo-toolkit' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .single-pricing-box .pricing-header h3' => 'color: {{VALUE}}', ], ] ); $this->add_responsive_control( 'title_size', [ 'label' => __( 'Title Font Size', 'tryo-toolkit' ), 'type' => Controls_Manager::SLIDER, 'size_units' => [ 'px' ], 'range' => [ 'px' => [ 'min' => 10, 'max' => 40, 'step' => 1, ], ], 'devices' => [ 'desktop', 'tablet', 'mobile' ], 'selectors' => [ '{{WRAPPER}} .single-pricing-box .pricing-header h3' => 'font-size: {{SIZE}}px;', ], ] ); $this->add_control( 'short_desc_color', [ 'label' => __( 'Short Description Color', 'tryo-toolkit' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .single-pricing-box .pricing-header p' => 'color: {{VALUE}}', ], ] ); $this->add_responsive_control( 'desc_size', [ 'label' => __( 'Short Description Font Size', 'tryo-toolkit' ), 'type' => Controls_Manager::SLIDER, 'size_units' => [ 'px' ], 'range' => [ 'px' => [ 'min' => 10, 'max' => 40, 'step' => 1, ], ], 'devices' => [ 'desktop', 'tablet', 'mobile' ], 'selectors' => [ '{{WRAPPER}} .single-pricing-box .pricing-header p' => 'font-size: {{SIZE}}px;', ], ] ); $this->add_control( 'price_color', [ 'label' => __( 'Price Color', 'tryo-toolkit' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .single-pricing-box .price' => 'color: {{VALUE}}', ], ] ); $this->add_responsive_control( 'price_size', [ 'label' => __( 'Price Font Size', 'tryo-toolkit' ), 'type' => Controls_Manager::SLIDER, 'size_units' => [ 'px' ], 'range' => [ 'px' => [ 'min' => 10, 'max' => 40, 'step' => 1, ], ], 'devices' => [ 'desktop', 'tablet', 'mobile' ], 'selectors' => [ '{{WRAPPER}} .single-pricing-box .price' => 'font-size: {{SIZE}}px;', ], ] ); $this->add_control( 'period_color', [ 'label' => __( 'Period Color', 'tryo-toolkit' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .single-pricing-box .price span' => 'color: {{VALUE}}', ], ] ); $this->add_responsive_control( 'period_size', [ 'label' => __( 'Period Font Size', 'tryo-toolkit' ), 'type' => Controls_Manager::SLIDER, 'size_units' => [ 'px' ], 'range' => [ 'px' => [ 'min' => 10, 'max' => 40, 'step' => 1, ], ], 'devices' => [ 'desktop', 'tablet', 'mobile' ], 'selectors' => [ '{{WRAPPER}} .single-pricing-box .price span' => 'font-size: {{SIZE}}px;', ], ] ); $this->add_responsive_control( 'btn_size', [ 'label' => __( 'Button Font Size', 'tryo-toolkit' ), 'type' => Controls_Manager::SLIDER, 'size_units' => [ 'px' ], 'range' => [ 'px' => [ 'min' => 10, 'max' => 40, 'step' => 1, ], ], 'devices' => [ 'desktop', 'tablet', 'mobile' ], 'selectors' => [ '{{WRAPPER}} .single-pricing-box .buy-btn .btn' => 'font-size: {{SIZE}}px;', ], ] ); $this->add_responsive_control( 'price_list', [ 'label' => __( 'List Font Size', 'tryo-toolkit' ), 'type' => Controls_Manager::SLIDER, 'size_units' => [ 'px' ], 'range' => [ 'px' => [ 'min' => 10, 'max' => 40, 'step' => 1, ], ], 'devices' => [ 'desktop', 'tablet', 'mobile' ], 'selectors' => [ '{{WRAPPER}} .single-pricing-box .pricing-features li' => 'font-size: {{SIZE}}px;', ], ] ); $this->end_controls_section(); } protected function render() { $settings = $this->get_settings_for_display(); $list_array = $settings['features']; // Inline Editing $this-> add_inline_editing_attributes('title','none'); $this-> add_inline_editing_attributes('short_desc','none'); $this-> add_inline_editing_attributes('price','none'); $this-> add_inline_editing_attributes('period','none'); if($settings['card_active'] == 'yes'): $class = 'active'; else: $class = ''; endif; ?> <div class="single-pricing-box <?php echo esc_attr( $class ); ?>"> <div class="pricing-header"> <h3 <?php echo $this-> get_render_attribute_string('title'); ?>><?php echo esc_html( $settings['title'] ); ?></h3> <p <?php echo $this-> get_render_attribute_string('title'); ?>><?php echo esc_html( $settings['short_desc'] ); ?></p> </div> <div class="price"> <span class="symbol"><?php echo esc_html( $settings['currency_symbol'] ); ?></span> <?php echo esc_html( $settings['price'] ); ?> <span><?php echo esc_html( $settings['period'] ); ?></span> </div> <ul class="pricing-features"> <?php foreach( $list_array as $list ): ?> <li><i class="<?php echo esc_attr( $list['icon'] ); ?>"></i> <?php echo esc_html( $list['text'] ); ?></li> <?php endforeach; ?> </ul> <?php if( $settings['button_text'] != '' ): ?> <div class="buy-btn"> <a href="<?php echo esc_url( $settings['button_link']['url'] ); ?>" class="btn btn-primary"><?php echo esc_html( $settings['button_text'] ); ?></a> </div> <?php endif; ?> </div> <?php } protected function _content_template() {} } Plugin::instance()->widgets_manager->register_widget_type( new Tryo_Pricing );
[-] banner-feature.php
[edit]
[-] profile-form.php
[edit]
[-] business-area.php
[edit]
[-] services-two.php
[edit]
[-] banner-two.php
[edit]
[-] signup.php
[edit]
[+]
..
[-] payment-experience-area.php
[edit]
[-] post.php
[edit]
[-] works.php
[edit]
[-] account-create.php
[edit]
[-] comparisons-table.php
[edit]
[-] partner-slider.php
[edit]
[-] app-download.php
[edit]
[-] feature-box.php
[edit]
[-] team.php
[edit]
[-] global-area.php
[edit]
[-] userinfo-details.php
[edit]
[-] banner-three.php
[edit]
[-] pricing.php
[edit]
[-] success-story-area.php
[edit]
[-] contact-card.php
[edit]
[-] contact-cta-box.php
[edit]
[-] services-area.php
[edit]
[-] ready-to-talk.php
[edit]
[-] section.php
[edit]
[-] receive-details.php
[edit]
[-] about-area.php
[edit]
[-] banner-four.php
[edit]
[-] send-details.php
[edit]
[-] support-area.php
[edit]
[-] invoicing.php
[edit]
[-] testimonials.php
[edit]
[-] funfact.php
[edit]
[-] signin.php
[edit]
[-] information-box.php
[edit]
[-] new-payment.php
[edit]
[-] banner-one.php
[edit]
[-] feedback-card.php
[edit]
[-] feature.php
[edit]