Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
W
woocommerce-quick-donation
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wordpress
woocommerce-quick-donation
Commits
7defe97c
Commit
7defe97c
authored
Feb 09, 2015
by
Tech No Freaky
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Version 0.3
Plugin Activation Issue Fixed.
parent
0e2b0fab
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
38 additions
and
39 deletions
+38
-39
readme.txt
readme.txt
+7
-5
woocommerce-quick-donation.php
woocommerce-quick-donation.php
+31
-34
No files found.
readme.txt
View file @
7defe97c
...
@@ -4,7 +4,7 @@ Donate link: http://varunsridharan.in
...
@@ -4,7 +4,7 @@ Donate link: http://varunsridharan.in
Tags: Woocommerce,Quick Dontion,Donation,Online Payment,Payment,Online,Donate,Monthly Goal
Tags: Woocommerce,Quick Dontion,Donation,Online Payment,Payment,Online,Donate,Monthly Goal
Requires at least: 3.0 plus WooCommerce 2.x or higher
Requires at least: 3.0 plus WooCommerce 2.x or higher
Tested up to: 4.0.1 + WooCommerce 2.x
Tested up to: 4.0.1 + WooCommerce 2.x
Stable tag: 0.
2
Stable tag: 0.
3
License: GPLv2 or later
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
License URI: http://www.gnu.org/licenses/gpl-2.0.html
...
@@ -37,11 +37,9 @@ This Plugin Can called by using the below short code
...
@@ -37,11 +37,9 @@ This Plugin Can called by using the below short code
1. Donation Form Template
1. Donation Form Template
`wc-quick-donation/template/donation_form.php`
`wc-quick-donation/template/donation_form.php`
2. Donation Processing Email Template
2. Donation Processing Email Template
`wc-quick-donation/template/donation_processing_html.php`
`wc-quick-donation/template/donation_processing_html.php && wc-quick-donation/template/donation_processing_plain.php`
`wc-quick-donation/template/donation_processing_plain.php`
3. Donation Completed Email Template
3. Donation Completed Email Template
`wc-quick-donation/template/donation_completed_html.php`
`wc-quick-donation/template/donation_completed_html.php && wc-quick-donation/template/donation_completed_plain.php`
`wc-quick-donation/template/donation_completed_plain.php`
Plugin Settings : ***Woocoomerce Settings => Quick Donation***
Plugin Settings : ***Woocoomerce Settings => Quick Donation***
...
@@ -93,6 +91,10 @@ Oops. Please User github / WordPress to post bugs. <a href="https://github.com/
...
@@ -93,6 +91,10 @@ Oops. Please User github / WordPress to post bugs. <a href="https://github.com/
3. Email Template Settings For Donation Completed.
3. Email Template Settings For Donation Completed.
== Changelog ==
== Changelog ==
= 0.3 =
* Plugin Activation Issue Fixed.
= 0.2 =
= 0.2 =
* Redirect User After Donation Added To Cart [Cart Page / Checkout Page]
* Redirect User After Donation Added To Cart [Cart Page / Checkout Page]
* Select Your Preferred Payment Gateway For Donation
* Select Your Preferred Payment Gateway For Donation
...
...
woocommerce-quick-donation.php
View file @
7defe97c
...
@@ -17,7 +17,7 @@
...
@@ -17,7 +17,7 @@
Plugin Name: Woocommerce Quick Donation
Plugin Name: Woocommerce Quick Donation
Plugin URI: http://varunsridharan.in/
Plugin URI: http://varunsridharan.in/
Description: Woocommerce Quick Donation
Description: Woocommerce Quick Donation
Version: 0.
2
Version: 0.
3
Author: Varun Sridharan
Author: Varun Sridharan
Author URI: http://varunsridharan.in/
Author URI: http://varunsridharan.in/
License: GPL2
License: GPL2
...
@@ -339,49 +339,46 @@ class wc_quick_donation{
...
@@ -339,49 +339,46 @@ class wc_quick_donation{
public
function
install
()
{
public
function
install
()
{
$exist
=
get_option
(
'wc_quick_donation_product_id'
);
$exist
=
get_option
(
'wc_quick_donation_product_id'
);
if
(
$exist
){
if
(
$exist
){
return
true
;
return
true
;
}
else
{
}
else
{
$post_id
=
$this
->
create_donation
();
$post_id
=
create_donation
();
add_option
(
'wc_quick_donation_product_id'
,
$post_id
);
add_option
(
'wc_quick_donation_product_id'
,
$post_id
);
add_option
(
'wc_quick_donation_orders'
,
''
);
add_option
(
'wc_quick_donation_orders'
,
''
);
add_site_option
(
'wc_quick_donation_product_id'
,
$post_id
)
;
add_site_option
(
'wc_quick_donation_product_id'
,
$post_id
)
;
}
}
}
}
/**
}
* Creats Donation Product IN WC
* @returns [[Type]] [[Description]]
*/
public
function
create_donation
(){
$userID
=
1
;
if
(
get_current_user_id
()){
$userID
=
get_current_user_id
();
}
$post
=
array
(
'post_author'
=>
$userID
,
'post_content'
=>
'Used For Donation'
,
'post_status'
=>
'publish'
,
'post_title'
=>
'Donation'
,
'post_type'
=>
'product'
,
);
$post_id
=
wp_insert_post
(
$post
,
$wp_error
);
update_post_meta
(
$post_id
,
'_stock_status'
,
'instock'
);
function
create_donation
(){
update_post_meta
(
$post_id
,
'_tax_status'
,
'none'
);
$userID
=
1
;
update_post_meta
(
$post_id
,
'_tax_class'
,
'zero-rate'
);
if
(
get_current_user_id
()){
update_post_meta
(
$post_id
,
'_visibility'
,
'hidden'
);
$userID
=
get_current_user_id
();
update_post_meta
(
$post_id
,
'_stock'
,
''
);
update_post_meta
(
$post_id
,
'_virtual'
,
'yes'
);
update_post_meta
(
$post_id
,
'_featured'
,
'no'
);
update_post_meta
(
$post_id
,
'_manage_stock'
,
"no"
);
update_post_meta
(
$post_id
,
'_sold_individually'
,
"yes"
);
update_post_meta
(
$post_id
,
'_sku'
,
'checkout-donation'
);
return
$post_id
;
}
}
}
$post
=
array
(
'post_author'
=>
$userID
,
'post_content'
=>
'Used For Donation'
,
'post_status'
=>
'publish'
,
'post_title'
=>
'Donation'
,
'post_type'
=>
'product'
,
);
$post_id
=
wp_insert_post
(
$post
,
$wp_error
);
update_post_meta
(
$post_id
,
'_stock_status'
,
'instock'
);
update_post_meta
(
$post_id
,
'_tax_status'
,
'none'
);
update_post_meta
(
$post_id
,
'_tax_class'
,
'zero-rate'
);
update_post_meta
(
$post_id
,
'_visibility'
,
'hidden'
);
update_post_meta
(
$post_id
,
'_stock'
,
''
);
update_post_meta
(
$post_id
,
'_virtual'
,
'yes'
);
update_post_meta
(
$post_id
,
'_featured'
,
'no'
);
update_post_meta
(
$post_id
,
'_manage_stock'
,
"no"
);
update_post_meta
(
$post_id
,
'_sold_individually'
,
"yes"
);
update_post_meta
(
$post_id
,
'_sku'
,
'checkout-donation'
);
return
$post_id
;
}
/**
/**
* Check if WooCommerce is active
* Check if WooCommerce is active
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment