start_controls_section( 'content_section', [ 'label' => __('GiveWP Donation Receipt Widget', 'give'), 'tab' => \Elementor\Controls_Manager::TAB_CONTENT, ] ); $this->add_control( 'error', [ 'label' => __('Error Message', 'give'), 'type' => \Elementor\Controls_Manager::TEXTAREA, 'description' => __('Custom text to show if there is an error showing the receipt table.', 'give'), 'default' => __('You are missing the donation id to view this donation receipt.', 'give'), 'placeholder' => __('You are missing the donation id to view this donation receipt.', 'give'), ] ); $this->add_control( 'success', [ 'label' => __('Success Message', 'give'), 'type' => \Elementor\Controls_Manager::TEXTAREA, 'description' => __('Custom text to show if the donation was successful.', 'give'), 'default' => __('Thank you for your donation.', 'give'), 'placeholder' => __('Thank you for your donation.', 'give'), ] ); $this->add_control( 'price', [ 'label' => __('Donation Total', 'give'), 'type' => \Elementor\Controls_Manager::SWITCHER, 'description' => __('Show or hide a row with the total donation amount.', 'give'), 'label_on' => __('Show', 'give'), 'label_off' => __('Hide', 'give'), 'default' => 'yes' ] ); $this->add_control( 'donor', [ 'label' => __('Donor', 'give'), 'type' => \Elementor\Controls_Manager::SWITCHER, 'description' => __('Show or hide a row with the donors full name.', 'give'), 'label_on' => __('Show', 'give'), 'label_off' => __('Hide', 'give'), 'default' => 'yes' ] ); $this->add_control( 'date', [ 'label' => __('Date', 'give'), 'type' => \Elementor\Controls_Manager::SWITCHER, 'description' => __('Show or hide a row with the date of the donation.', 'give'), 'label_on' => __('Show', 'give'), 'label_off' => __('Hide', 'give'), 'default' => 'yes' ] ); $this->add_control( 'method', [ 'label' => __('Payment Method', 'give'), 'type' => \Elementor\Controls_Manager::SWITCHER, 'description' => __('Show or hide a row with the name of the payment type (credit card, offline, etc).', 'give'), 'label_on' => __('Show', 'give'), 'label_off' => __('Hide', 'give'), 'default' => 'yes' ] ); $this->add_control( 'payment_id', [ 'label' => __('Payment ID', 'give'), 'type' => \Elementor\Controls_Manager::SWITCHER, 'description' => __('Show or hide a row with the ID of the donation.', 'give'), 'label_on' => __('Show', 'give'), 'label_off' => __('Hide', 'give'), 'default' => 'yes' ] ); $this->add_control( 'status', [ 'label' => __('Status', 'give'), 'type' => \Elementor\Controls_Manager::SWITCHER, 'description' => __('Show or hide a row with the status of the payment.', 'give'), 'label_on' => __('Show', 'give'), 'label_off' => __('Hide', 'give'), 'default' => 'no' ] ); $this->add_control( 'company', [ 'label' => __('Company Name', 'give'), 'type' => \Elementor\Controls_Manager::SWITCHER, 'description' => __('Show or hide a row with the company name the donor provided.', 'give'), 'label_on' => __('Show', 'give'), 'label_off' => __('Hide', 'give'), 'default' => 'no' ] ); $this->add_control( 'status_notice', [ 'label' => __('Payment Status Notice', 'give'), 'type' => \Elementor\Controls_Manager::SWITCHER, 'description' => __('Show or hide an alert above the receipt table showing the status of the donation payment.', 'give'), 'label_on' => __('Show', 'give'), 'label_off' => __('Hide', 'give'), 'default' => 'yes' ] ); $this->add_control( 'give_receipt_info', [ 'label' => '', 'type' => \Elementor\Controls_Manager::RAW_HTML, 'content_classes' => 'give-info', 'raw' => '

' . __('GIVEWP RECEIPT WIDGET', 'give') . '

' . __('This is the GiveWP Receipt widget. Choose the columns you want to have appear for your donor receipts.', 'give') . '

' . __('NOTE:', 'give') . ' ' . __('This is a sample receipt with all fields exposed. The alerts and info will show correctly for your donors. This receipt is just for preview/editing purposes.', 'give') . '

' ] ); $this->end_controls_section(); } /** * Render the [give_receipt] 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(); $error = esc_html($settings['error']); $success = esc_html($settings['success']); $price = ('yes' === $settings['price'] ? '' : 'price="false"'); $donor = ('yes' === $settings['donor'] ? '' : 'donor="false"'); $date = ('yes' === $settings['date'] ? '' : 'date="false"'); $method = ('yes' === $settings['method'] ? '' : 'payment_method="false"'); $id = ('yes' === $settings['payment_id'] ? '' : 'payment_id="false"'); $status = ('yes' === $settings['status'] ? 'payment_status="true"' : ''); $company = ('yes' === $settings['company'] ? 'company_name="true"' : ''); $notice = ('yes' === $settings['status_notice'] ? '' : 'status_notice="false"'); // Add-on compatibility // Adding PDF Receipt row, and Subscription table $pdfreceipts = (class_exists('Give_PDF_Receipts')) ? "true" : "false"; $recurring = (class_exists('Give_Recurring')) ? "true" : "false"; if (!\Elementor\Plugin::$instance->editor->is_edit_mode()) { $html = do_shortcode(' [give_receipt ' . $error . ' ' . $price . ' ' . $donor . ' ' . $date . ' ' . $method . ' ' . $id . ' ' . $status . ' ' . $company . ' ' . $notice . ']' ); echo '
'; echo $html; echo '
'; } else { ?>

Impress.org
$25.00
3
: »
$25.00 /
1 /
»