Commit 0e2b0fab authored by Tech No Freaky's avatar Tech No Freaky

0.2

Redirect User After Donation Added To Cart [Cart Page / Checkout Page]
Select Your Preferred Payment Gateway For Donation
Custom Email Template For Donation Processing
Custom Email Template For Donation Completed
Some Minor Bug Fix
parent 4993e957
......@@ -4,7 +4,7 @@ Donate link: http://varunsridharan.in
Tags: Woocommerce,Quick Dontion,Donation,Online Payment,Payment,Online,Donate,Monthly Goal
Requires at least: 3.0 plus WooCommerce 2.x or higher
Tested up to: 4.0.1 + WooCommerce 2.x
Stable tag: 0.1
Stable tag: 0.2
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
......@@ -12,19 +12,44 @@ Online Donation Using Woocoomerce. for woocommerce user's
== Description ==
<h3> <blink> What's New In 0.2 </blink></h3>
* Redirect User After Donation Added To Cart [Cart Page / Checkout Page]
* Select Your Preferred Payment Gateway For Donation
* Custom Email Template For Donation Processing
* Custom Email Template For Donation Completed
* Some Minor Bug Fix
<h3> What We Will Give In Up Coming Releases </h3>
* Customized Report Page [Need Help]
* Better Email Template
* Target / Goal For The Project
WooCommerce Shopping Cart Donation which makes woocoomerce to use for online donation purpose.
This plugin will create a new product in the name of *donation*.
This plugin will create a new product in the name of **donation**.
This Plugin Can called by using the below shortcode
This Plugin Can called by using the below short code
`[wc_quick_donation]`
This Plugin Template Can Be Found Under [You Can Modify The Template Buy Copying To Your Theme's Folder]
**Plugin Template List** *[You Can Modify The Template Buy Copying To Your Theme's Folder]*
1. Donation Form Template
`wc-quick-donation/template/donation_form.php`
2. Donation Processing Email Template
`wc-quick-donation/template/donation_processing_html.php`
`wc-quick-donation/template/donation_processing_plain.php`
3. Donation Completed Email Template
`wc-quick-donation/template/donation_completed_html.php`
`wc-quick-donation/template/donation_completed_plain.php`
Plugin Settings : ***Woocoomerce Settings => Quick Donation***
This Plugin Settings Can Be Found Under
`Woocoomerce Settings => Quick Donation`
Email Template Settings : ***Woocommerce Settings => Emails => Donation Processing & Completed***
== Upgrade Notice ==
We have updated ***donation-form.php*** template. so please replace the template if you have modified
== Installation ==
......@@ -48,17 +73,32 @@ This Plugin Can Be Called Using `[wc_quick_donation]`
Yes. Its Possible By Copying To Your Theme's Folder `wp-content/plugins/wc-quick-donation/template/donation_form.php`
**What Is The Use Of Project Field ?**
Project is like [category / division]. for which you donation. muiltiple can be entered by `,` seperated eg : `Project 1,Project 2`
Project is like [category / division]. for which you donation. multiple can be entered by `,` separated eg : `Project 1,Project 2`
**Donation Plugin Not Working After Upgrading To 0.2**
As we have updated ***donation-form.php*** template. it may not be working with the old one. so please replace the template if you have modified or contact us.
**How i can get project name in email template**
You can get the name by calling the variable `$project_name`
**I have an idea for your plugin!**
That\\'s great. We are always open to your input, and we would like to add anything we think will be useful to a lot of people. Please send your comment/idea to varunsridharan23@gmail.com
That's great. We are always open to your input, and we would like to add anything we think will be useful to a lot of people. Please send your comment/idea to varunsridharan23@gmail.com
**I found a bug!**
Oops. Please User github / WordPress to post bugs. <a href="https://github.com/technofreaky/woocomerce-quick-donation/"> Open an Issue </a>
== Screenshots ==
1. Settings Panel
2. Email Template Settings For Donation Processing
3. Email Template Settings For Donation Completed.
== Changelog ==
= 0.2 =
* Redirect User After Donation Added To Cart [Cart Page / Checkout Page]
* Select Your Preferred Payment Gateway For Donation
* Custom Email Template For Donation Processing
* Custom Email Template For Donation Completed
* Some Minor Bug Fix
= 0.1 =
* Base Version
\ No newline at end of file
screenshot-1.png

55.9 KB | W: | H:

screenshot-1.png

53 KB | W: | H:

screenshot-1.png
screenshot-1.png
screenshot-1.png
screenshot-1.png
  • 2-up
  • Swipe
  • Onion skin
<?php
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly ?>
<?php do_action( 'woocommerce_email_header', $email_heading ); ?>
<p><?php printf( __( 'Thanks For Your Donation %s. Their order is as follows:', 'woocommerce' ), $order->billing_first_name . ' ' . $order->billing_last_name ); ?></p>
<?php do_action( 'woocommerce_email_before_order_table', $order, true, false ); ?>
<h2><a href="<?php echo admin_url( 'post.php?post=' . $order->id . '&action=edit' ); ?>"><?php printf( __( 'Order: %s', 'woocommerce'), $order->get_order_number() ); ?></a> <?php echo $project_name; ?> (<?php printf( '<time datetime="%s">%s</time>', date_i18n( 'c', strtotime( $order->order_date ) ), date_i18n( wc_date_format(), strtotime( $order->order_date ) ) ); ?>)</h2>
<table cellspacing="0" cellpadding="6" style="width: 100%; border: 1px solid #eee;" border="1" bordercolor="#eee">
<thead>
<tr>
<th scope="col" style="text-align:left; border: 1px solid #eee;"><?php _e( 'Product', 'woocommerce' ); ?></th>
<th scope="col" style="text-align:left; border: 1px solid #eee;"><?php _e( 'Quantity', 'woocommerce' ); ?></th>
<th scope="col" style="text-align:left; border: 1px solid #eee;"><?php _e( 'Price', 'woocommerce' ); ?></th>
</tr>
</thead>
<tbody>
<?php echo $order->email_order_items_table( false, true ); ?>
</tbody>
<tfoot>
<?php
if ( $totals = $order->get_order_item_totals() ) {
$i = 0;
foreach ( $totals as $total ) {
$i++;
?><tr>
<th scope="row" colspan="2" style="text-align:left; border: 1px solid #eee; <?php if ( $i == 1 ) echo 'border-top-width: 4px;'; ?>"><?php echo $total['label']; ?></th>
<td style="text-align:left; border: 1px solid #eee; <?php if ( $i == 1 ) echo 'border-top-width: 4px;'; ?>"><?php echo $total['value']; ?></td>
</tr><?php
}
}
?>
</tfoot>
</table>
<?php do_action( 'woocommerce_email_after_order_table', $order, true, false ); ?>
<?php do_action( 'woocommerce_email_order_meta', $order, true, false ); ?>
<h2><?php _e( 'Customer details', 'woocommerce' ); ?></h2>
<?php if ( $order->billing_email ) : ?>
<p><strong><?php _e( 'Email:', 'woocommerce' ); ?></strong> <?php echo $order->billing_email; ?></p>
<?php endif; ?>
<?php if ( $order->billing_phone ) : ?>
<p><strong><?php _e( 'Tel:', 'woocommerce' ); ?></strong> <?php echo $order->billing_phone; ?></p>
<?php endif; ?>
<?php wc_get_template( 'emails/email-addresses.php', array( 'order' => $order ) ); ?>
<?php do_action( 'woocommerce_email_footer' ); ?>
<?php
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
echo $email_heading . "\n\n";
echo sprintf( __( 'You have received an order from %s. Their order is as follows:', 'woocommerce' ), $order->billing_first_name . ' ' . $order->billing_last_name ) . "\n\n";
echo "****************************************************\n\n";
do_action( 'woocommerce_email_before_order_table', $order, $sent_to_admin, $plain_text );
echo sprintf( __( 'Order number: %s', 'woocommerce'), $order->get_order_number() ) . "\n";
echo sprintf( __( 'Order link: %s', 'woocommerce'), admin_url( 'post.php?post=' . $order->id . '&action=edit' ) ) . "\n";
echo sprintf( __( 'Order date: %s', 'woocommerce'), date_i18n( __( 'jS F Y', 'woocommerce' ), strtotime( $order->order_date ) ) ) . "\n";
do_action( 'woocommerce_email_order_meta', $order, $sent_to_admin, $plain_text );
echo "\n" . $order->email_order_items_table( false, true, '', '', '', true );
echo "----------\n\n";
if ( $totals = $order->get_order_item_totals() ) {
foreach ( $totals as $total ) {
echo $total['label'] . "\t " . $total['value'] . "\n";
}
}
echo "\n****************************************************\n\n";
do_action( 'woocommerce_email_after_order_table', $order, $sent_to_admin, $plain_text );
echo __( 'Customer details', 'woocommerce' ) . "\n";
if ( $order->billing_email )
echo __( 'Email:', 'woocommerce' ); echo $order->billing_email . "\n";
if ( $order->billing_phone )
echo __( 'Tel:', 'woocommerce' ); ?> <?php echo $order->billing_phone . "\n";
wc_get_template( 'emails/plain/email-addresses.php', array( 'order' => $order ) );
echo "\n****************************************************\n\n";
echo apply_filters( 'woocommerce_email_footer_text', get_option( 'woocommerce_email_footer_text' ) );
\ No newline at end of file
......@@ -22,10 +22,10 @@ global $donate;
<div class="input text">
<label>Donation (&pound;):</label>
<input type="text" name="jc-donation" value="<?php echo $donate; ?>"/>
<input type="text" name="donation_ammount" value="<?php echo $donate; ?>"/>
</div>
<div class="submit_btn">
<input type="submit" name="donate-btn" value="Add Donation"/>
<input type="submit" name="donation_add" value="Add Donation"/>
</div>
</div>
</td>
......
<?php
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly ?>
<?php do_action( 'woocommerce_email_header', $email_heading ); ?>
<p><?php printf( __( 'Thanks For Your Donation %s. Their order is as follows:', 'woocommerce' ), $order->billing_first_name . ' ' . $order->billing_last_name ); ?></p>
<?php do_action( 'woocommerce_email_before_order_table', $order, true, false ); ?>
<h2><a href="<?php echo admin_url( 'post.php?post=' . $order->id . '&action=edit' ); ?>"><?php printf( __( 'Order: %s', 'woocommerce'), $order->get_order_number() ); ?></a> <?php echo $project_name; ?> (<?php printf( '<time datetime="%s">%s</time>', date_i18n( 'c', strtotime( $order->order_date ) ), date_i18n( wc_date_format(), strtotime( $order->order_date ) ) ); ?>)</h2>
<table cellspacing="0" cellpadding="6" style="width: 100%; border: 1px solid #eee;" border="1" bordercolor="#eee">
<thead>
<tr>
<th scope="col" style="text-align:left; border: 1px solid #eee;"><?php _e( 'Product', 'woocommerce' ); ?></th>
<th scope="col" style="text-align:left; border: 1px solid #eee;"><?php _e( 'Quantity', 'woocommerce' ); ?></th>
<th scope="col" style="text-align:left; border: 1px solid #eee;"><?php _e( 'Price', 'woocommerce' ); ?></th>
</tr>
</thead>
<tbody>
<?php echo $order->email_order_items_table( false, true ); ?>
</tbody>
<tfoot>
<?php
if ( $totals = $order->get_order_item_totals() ) {
$i = 0;
foreach ( $totals as $total ) {
$i++;
?><tr>
<th scope="row" colspan="2" style="text-align:left; border: 1px solid #eee; <?php if ( $i == 1 ) echo 'border-top-width: 4px;'; ?>"><?php echo $total['label']; ?></th>
<td style="text-align:left; border: 1px solid #eee; <?php if ( $i == 1 ) echo 'border-top-width: 4px;'; ?>"><?php echo $total['value']; ?></td>
</tr><?php
}
}
?>
</tfoot>
</table>
<?php do_action( 'woocommerce_email_after_order_table', $order, true, false ); ?>
<?php do_action( 'woocommerce_email_order_meta', $order, true, false ); ?>
<h2><?php _e( 'Customer details', 'woocommerce' ); ?></h2>
<?php if ( $order->billing_email ) : ?>
<p><strong><?php _e( 'Email:', 'woocommerce' ); ?></strong> <?php echo $order->billing_email; ?></p>
<?php endif; ?>
<?php if ( $order->billing_phone ) : ?>
<p><strong><?php _e( 'Tel:', 'woocommerce' ); ?></strong> <?php echo $order->billing_phone; ?></p>
<?php endif; ?>
<?php wc_get_template( 'emails/email-addresses.php', array( 'order' => $order ) ); ?>
<?php do_action( 'woocommerce_email_footer' ); ?>
<?php
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
echo $email_heading . "\n\n";
echo sprintf( __( 'You have received an order from %s. Their order is as follows:', 'woocommerce' ), $order->billing_first_name . ' ' . $order->billing_last_name ) . "\n\n";
echo "****************************************************\n\n";
do_action( 'woocommerce_email_before_order_table', $order, $sent_to_admin, $plain_text );
echo sprintf( __( 'Order number: %s', 'woocommerce'), $order->get_order_number() ) . "\n";
echo sprintf( __( 'Order link: %s', 'woocommerce'), admin_url( 'post.php?post=' . $order->id . '&action=edit' ) ) . "\n";
echo sprintf( __( 'Order date: %s', 'woocommerce'), date_i18n( __( 'jS F Y', 'woocommerce' ), strtotime( $order->order_date ) ) ) . "\n";
do_action( 'woocommerce_email_order_meta', $order, $sent_to_admin, $plain_text );
echo "\n" . $order->email_order_items_table( false, true, '', '', '', true );
echo "----------\n\n";
if ( $totals = $order->get_order_item_totals() ) {
foreach ( $totals as $total ) {
echo $total['label'] . "\t " . $total['value'] . "\n";
}
}
echo "\n****************************************************\n\n";
do_action( 'woocommerce_email_after_order_table', $order, $sent_to_admin, $plain_text );
echo __( 'Customer details', 'woocommerce' ) . "\n";
if ( $order->billing_email )
echo __( 'Email:', 'woocommerce' ); echo $order->billing_email . "\n";
if ( $order->billing_phone )
echo __( 'Tel:', 'woocommerce' ); ?> <?php echo $order->billing_phone . "\n";
wc_get_template( 'emails/plain/email-addresses.php', array( 'order' => $order ) );
echo "\n****************************************************\n\n";
echo apply_filters( 'woocommerce_email_footer_text', get_option( 'woocommerce_email_footer_text' ) );
\ No newline at end of file
<?php
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
/**
* A custom Expedited Order WooCommerce Email class
*
* @since 0.1
* @extends \WC_Email
*/
class wc_quick_donation_completed_donation_email extends WC_Email {
/**
* Set email defaults
*
* @since 0.1
*/
public function __construct() {
$this->project_name = '';
$this->id = 'wc_quick_donation_completed_donation_email';
$this->title = 'Donation completed';
$this->description = 'Email Sent When New Donation Is Placed';
$this->subject = 'Thank you for your donation {project_name}';
$this->heading = 'Thank you for your donation {project_name}';
$this->template_base = wc_qd_p.'template/';
$this->template_html = 'donation_completed_html.php';
$this->template_plain = 'donation_completed_plain.php';
// Trigger on new paid orders
add_action( 'woocommerce_order_status_completed_notification', array( $this, 'trigger' ) );
parent::__construct();
}
/**
* Determine if the email should actually be sent and setup email merge variables
*
* @since 0.1
* @param int $order_id
*/
public function trigger( $order_id ) {
if ( ! $order_id )
return;
$this->project_name = get_post_meta($order_id, 'project_details', true );
$order = new WC_Order( $order_id );
$this->object = $order;
$this->recipient = $this->object->billing_email;
$products_in_order = array();
foreach ( $order->get_items() as $item ) {
foreach($item['item_meta']['_product_id'] as $id){ $products_in_order[] = $id; }
}
if(in_array(get_option('wc_quick_donation_product_id'),$products_in_order)){
$this->find[] = '{order_date}';
$this->replace[] = date_i18n( woocommerce_date_format(), strtotime( $this->object->order_date ) );
$this->find[] = '{project_name}';
$this->replace[] = get_post_meta($order_id, 'project_details', true );
$this->find[] = '{order_number}';
$this->replace[] = $this->object->get_order_number();
if ( ! $this->is_enabled())
return;
$this->send( $this->get_recipient(), $this->get_subject(), $this->get_content(), $this->get_headers(), $this->get_attachments() );
}
}
/**
* Initialize Settings Form Fields
*
* @since 0.1
*/
public function init_form_fields() {
$this->form_fields = array(
'enabled' => array(
'title' => 'Enable/Disable',
'type' => 'checkbox',
'label' => 'Enable this email notification',
'default' => 'yes'
),
'subject' => array(
'title' => 'Subject',
'type' => 'text',
'description' => sprintf( 'This controls the email subject line. Leave blank to use the default subject: <code>%s</code>.', $this->subject ),
'placeholder' => '',
'default' => ''
),
'heading' => array(
'title' => 'Email Heading',
'type' => 'text',
'description' => sprintf( __( 'This controls the main heading contained within the email notification. Leave blank to use the default heading: <code>%s</code>.' ), $this->heading ),
'placeholder' => '',
'default' => ''
),
'email_type' => array(
'title' => 'Email type',
'type' => 'select',
'description' => 'Choose which format of email to send.',
'default' => 'html',
'class' => 'email_type',
'options' => array(
'plain' => 'Plain text',
'html' => 'HTML',
'multipart' => 'Multipart'
)
)
);
}
/**
* get_content_html function.
*
* @since 0.1
* @return string
*/
public function get_content_html() {
ob_start();
woocommerce_get_template($this->template_html,array('project_name'=>$this->project_name,'order' => $this->object, 'email_heading' => $this->get_heading()),'',$this->template_base);
return ob_get_clean();
}
/**
* get_content_plain function.
*
* @since 0.1
* @return string
*/
public function get_content_plain() {
ob_start();
woocommerce_get_template($this->template_plain,array('project_name'=>$this->project_name,'order' => $this->object, 'email_heading' => $this->get_heading()),'',$this->template_base);
return ob_get_clean();
}
}
<?php
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
/**
* A custom Expedited Order WooCommerce Email class
*
* @since 0.1
* @extends \WC_Email
*/
class wc_quick_donation_processing_donation_email extends WC_Email {
/**
* Set email defaults
*
* @since 0.1
*/
public function __construct() {
$this->project_name = '';
$this->id = 'wc_quick_donation_processing_donation_email_processing';
$this->title = 'Donation Processing';
$this->description = 'Email Sent When New Donation Is Placed';
$this->subject = 'Thank you for your donation {project_name}';
$this->heading = 'Thank you for your donation {project_name}';
$this->template_base = wc_qd_p.'template/';
$this->template_html = 'donation_processing_html.php';
$this->template_plain = 'donation_processing_plain.php';
// Trigger on new paid orders
add_action( 'woocommerce_order_status_pending_to_processing_notification', array( $this, 'trigger' ) );
add_action( 'woocommerce_order_status_pending_to_on-hold_notification', array( $this, 'trigger' ) );
parent::__construct();
}
/**
* Determine if the email should actually be sent and setup email merge variables
*
* @since 0.1
* @param int $order_id
*/
public function trigger( $order_id ) {
if ( ! $order_id )
return;
$this->project_name = get_post_meta($order_id, 'project_details', true );
$order = new WC_Order( $order_id );
$this->object = $order;
$this->recipient = $this->object->billing_email;
$products_in_order = array();
foreach ( $order->get_items() as $item ) {
foreach($item['item_meta']['_product_id'] as $id){ $products_in_order[] = $id; }
}
if(in_array(get_option('wc_quick_donation_product_id'),$products_in_order)){
$this->find[] = '{order_date}';
$this->replace[] = date_i18n( woocommerce_date_format(), strtotime( $this->object->order_date ) );
$this->find[] = '{project_name}';
$this->replace[] = $this->project;
$this->find[] = '{order_number}';
$this->replace[] = $this->object->get_order_number();
if ( ! $this->is_enabled())
return;
$this->send( $this->get_recipient(), $this->get_subject(), $this->get_content(), $this->get_headers(), $this->get_attachments() );
}
}
/**
* Initialize Settings Form Fields
*
* @since 0.1
*/
public function init_form_fields() {
$this->form_fields = array(
'enabled' => array(
'title' => 'Enable/Disable',
'type' => 'checkbox',
'label' => 'Enable this email notification',
'default' => 'yes'
),
'subject' => array(
'title' => 'Subject',
'type' => 'text',
'description' => sprintf( 'This controls the email subject line. Leave blank to use the default subject: <code>%s</code>.', $this->subject ),
'placeholder' => '',
'default' => ''
),
'heading' => array(
'title' => 'Email Heading',
'type' => 'text',
'description' => sprintf( __( 'This controls the main heading contained within the email notification. Leave blank to use the default heading: <code>%s</code>.' ), $this->heading ),
'placeholder' => '',
'default' => ''
),
'email_type' => array(
'title' => 'Email type',
'type' => 'select',
'description' => 'Choose which format of email to send.',
'default' => 'html',
'class' => 'email_type',
'options' => array(
'plain' => 'Plain text',
'html' => 'HTML',
'multipart' => 'Multipart'
)
)
);
}
/**
* get_content_html function.
*
* @since 0.1
* @return string
*/
public function get_content_html() {
ob_start();
woocommerce_get_template($this->template_html,array('project_name'=>$this->project_name,'order' => $this->object, 'email_heading' => $this->get_heading()),'',$this->template_base);
return ob_get_clean();
}
/**
* get_content_plain function.
*
* @since 0.1
* @return string
*/
public function get_content_plain() {
ob_start();
woocommerce_get_template($this->template_plain,array('project_name'=>$this->project_name,'order' => $this->object, 'email_heading' => $this->get_heading()),'',$this->template_base);
return ob_get_clean();
}
}
This diff is collapsed.
<?php
class WC_Quick_Donation_Settings extends WC_Settings_Page {
/**
* Constructor
*/
public function __construct() {
$this->id = 'wc_quick_donation';
add_filter( 'woocommerce_settings_tabs_array', array( $this, 'add_settings_tab' ), 50 );
add_action( 'woocommerce_sections_' . $this->id, array( $this, 'output_sections' ) );
add_action( 'woocommerce_settings_' . $this->id, array( $this, 'output' ) );
add_action( 'woocommerce_settings_save_' . $this->id, array( $this, 'save' ) );
}
/**
* Add plugin options tab
*
* @return array
*/
public function add_settings_tab( $settings_tabs ) {
$settings_tabs[$this->id] = 'WC Quick Donation';
return $settings_tabs;
}
/**
* Get sections
*
* @return array
*/
public function get_sections() {
$sections = array(
'general' => __( 'General Settings', $this->id )
);
return apply_filters( 'woocommerce_get_sections_' . $this->id, $sections );
}
/**
* Get sections
*
* @return array
*/
public function get_settings( $section = null ) {
global $wc_quick_buy;
switch( $section ){
case 'general' :
case '' :
$settings = array(
'section_title' => array(
'name' => 'Woocommerce Quick Donation Settings',
'type' => 'title',
'desc' => 'Just Call <code><strong>[wc_quick_donation]</strong></code> short code any where in your page,post,widgets or template <br/>
To Customize the <strong>Donation Form</strong> copy the template file from <code>woocommerce-quick-donation/template/donation_form.php</code> to your <code>theme/woocommerce</code> folder.
',
'id' => 'wc_quick_donation_section_title'
),
'remove_cart_items' => array(
'name' => 'Auto Remove Cart Items',
'desc' => 'Removes Other Cart Items If Donation Aded To Cart.',
'id' => 'wc_quick_donation_cart_remove',
'type' => 'select',
'class' =>'chosen_select',
'options' => array('false' => 'Keep All Items','true'=>'Remove All Items')
),
'redirect' => array(
'name' => 'Redirect User To',
'desc' => 'After Donation Added To Cart.',
'id' => 'wc_quick_donation_redirect',
'type' => 'select',
'class' =>'chosen_select',
'options' => array('checkout' => 'Checkout Page','cart'=>'Cart Page','false' => 'None')
),
'payment_gateway' => array(
'name' => 'Allowed Payment Gateway\'s',
'desc' => 'Select Payment Gateway for donation..',
'id' => 'wc_quick_donation_payment_gateway',
'type' => 'multiselect',
'class' =>'chosen_select',
'options' => $wc_quick_buy->get_payments_gateway()
),
'project_names' => array(
'name' => 'Project Names',
'type' => 'textarea',
'desc' => 'Add Names By <code>,</code> Seperated ',
'id' => 'wc_quick_donation_projects',
'default' => 'Project1,Project2'
),
'order_project_title' => array(
'name' => 'Order Project Title',
'type' => 'text',
'desc' => 'Title to view in order edit page',
'id' => 'wc_quick_donation_project_section_title',
'default' =>'For Project'
),
'order_notes_title' => array(
'name' => 'Order Notes Title',
'type' => 'text',
'desc' => 'to display project name use <code>Project Name : %s</code>',
'id' => 'wc_quick_donation_order_notes_title',
'default' =>'Project Name %s'
),
'section_end' => array(
'type' => 'sectionend',
'id' => 'wc_settings_tab_demo_section_end'
)
);
break;
case 'email_template':
break;
}
return apply_filters( 'wc_settings_tab_'.$this->id.'_settings', $settings, $section );
}
/**
* Output the settings
*/
public function output() {
global $current_section;
$settings = $this->get_settings( $current_section );
WC_Admin_Settings::output_fields( $settings );
}
/**
* Save settings
*/
public function save() {
global $current_section;
$settings = $this->get_settings( $current_section );
WC_Admin_Settings::save_fields( $settings );
}
}
return new WC_Quick_Donation_Settings();
?>
\ No newline at end of file
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment