start_controls_section( 'give_subscriptions_settings', [ 'label' => __('GiveWP Subscriptions Widget', 'give'), 'tab' => \Elementor\Controls_Manager::TAB_CONTENT, ] ); $this->add_control( 'show_status', [ 'label' => __('Status', 'give'), 'type' => \Elementor\Controls_Manager::SWITCHER, 'description' => __('Show or hide the subscription status column.', 'give'), 'label_on' => __('Show', 'give'), 'label_off' => __('Hide', 'give'), 'default' => 'yes' ] ); $this->add_control( 'show_renewal_date', [ 'label' => __('Renewal Date', 'give'), 'type' => \Elementor\Controls_Manager::SWITCHER, 'description' => __('Show or hide a column with the subscription renewal date.', 'give'), 'label_on' => __('Show', 'give'), 'label_off' => __('Hide', 'give'), 'default' => 'yes' ] ); $this->add_control( 'show_progress', [ 'label' => __('Progress', 'give'), 'type' => \Elementor\Controls_Manager::SWITCHER, 'description' => __('Show or hide a column with progress of the subscription.', 'give'), 'label_on' => __('Show', 'give'), 'label_off' => __('Hide', 'give'), 'default' => 'no' ] ); $this->add_control( 'show_start_date', [ 'label' => __('Start Date', 'give'), 'type' => \Elementor\Controls_Manager::SWITCHER, 'description' => __('Show or hide a column with the subscription start date.', 'give'), 'label_on' => __('Show', 'give'), 'label_off' => __('Hide', 'give'), 'default' => 'no' ] ); $this->add_control( 'show_end_date', [ 'label' => __('End Date', 'give'), 'type' => \Elementor\Controls_Manager::SWITCHER, 'description' => __('Show or hide a column with the subscription end date.', 'give'), 'label_on' => __('Show', 'give'), 'label_off' => __('Hide', 'give'), 'default' => 'no' ] ); $this->add_control( 'subscriptions_per_page', [ 'label' => __('Subscriptions per Page', 'give'), 'type' => \Elementor\Controls_Manager::TEXT, 'description' => __('The number of subscriptions to show before pagination appears.', 'give'), 'input_type' => 'number', 'default' => '30' ] ); $this->add_control( 'give_subscriptions_info', [ 'label' => '', 'type' => \Elementor\Controls_Manager::RAW_HTML, 'content_classes' => 'give-info', 'raw' => '

' . __('GIVEWP SUBSCRIPTION HISTORY WIDGET', 'give') . '

' . __('This is the GiveWP Subscriptions widget. Choose which columns you want to have appear for your donors subscription history.', 'give') . '

' ] ); $this->end_controls_section(); } /** * Render the [give_subscriptions] output on the frontend. * * Written in PHP and used to generate the final HTML. * * @since 4.7.0 migrated from givewp-elementor-widgets * @access protected */ protected function render() { $settings = $this->get_settings_for_display(); $showStatus = ('yes' === $settings['show_status'] ? '' : 'show_status="false"'); $showRenewalDate = ('yes' === $settings['show_renewal_date'] ? 'show_renewal_date="true"' : ''); $showProgress = ('yes' === $settings['show_progress'] ? '' : 'show_progress="false"'); $showStartDate = ('yes' === $settings['show_start_date'] ? '' : 'show_start_date="false"'); $showEndDate = ('yes' === $settings['show_end_date'] ? 'show_end_date="true"' : ''); $subscriptionsPerPage = ('yes' === $settings['subscriptions_per_page'] ? 'subscriptions_per_page="true"' : ''); if (!\Elementor\Plugin::$instance->editor->is_edit_mode()) { $html = do_shortcode( ' [give_subscriptions ' . $showStatus . ' ' . $showRenewalDate . ' ' . $showProgress . ' ' . $showStartDate . ' ' . $showEndDate . ' ' . $subscriptionsPerPage . ']' ); } else { ob_start(); ?>

$25.00 /
1 /  | 
'; echo $html; echo ''; } }