Version Description
- Add 'Redirect to Page' option, let user choose redirecting to any page after add to cart pressed
- Updated wrong hyperlink
Download this release
Release Info
Developer | terrytsang |
Plugin | WooCommerce Direct Checkout |
Version | 1.0.1 |
Comparing to | |
See all releases |
Version 1.0.1
- .project +11 -0
- languages/wc-direct-checkout-en_GB.mo +0 -0
- languages/wc-direct-checkout-en_GB.po +51 -0
- languages/wc-direct-checkout-zh_CN.mo +0 -0
- languages/wc-direct-checkout-zh_CN.po +51 -0
- readme.txt +64 -0
- screenshot-01.png +0 -0
- screenshot-02.png +0 -0
- screenshot-03.png +0 -0
- screenshot-1.png +0 -0
- screenshot-2.png +0 -0
- screenshot-3.png +0 -0
- wc-direct-checkout.php +269 -0
- wc-direct-checkout.pot +51 -0
.project
ADDED
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="UTF-8"?>
|
2 |
+
<projectDescription>
|
3 |
+
<name>woocommerce-direct-checkout</name>
|
4 |
+
<comment></comment>
|
5 |
+
<projects>
|
6 |
+
</projects>
|
7 |
+
<buildSpec>
|
8 |
+
</buildSpec>
|
9 |
+
<natures>
|
10 |
+
</natures>
|
11 |
+
</projectDescription>
|
languages/wc-direct-checkout-en_GB.mo
ADDED
Binary file
|
languages/wc-direct-checkout-en_GB.po
ADDED
@@ -0,0 +1,51 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
msgid ""
|
2 |
+
msgstr ""
|
3 |
+
"Project-Id-Version: WooCommerce Direct Checkout v1.0.0\n"
|
4 |
+
"Report-Msgid-Bugs-To: \n"
|
5 |
+
"POT-Creation-Date: \n"
|
6 |
+
"PO-Revision-Date: 2013-07-10 15:54:14+0000\n"
|
7 |
+
"Last-Translator: admin <terrytsang811@gmail.com>\n"
|
8 |
+
"Language-Team: \n"
|
9 |
+
"MIME-Version: 1.0\n"
|
10 |
+
"Content-Type: text/plain; charset=UTF-8\n"
|
11 |
+
"Content-Transfer-Encoding: 8bit\n"
|
12 |
+
"Plural-Forms: nplurals=2; plural=n != 1;\n"
|
13 |
+
"X-Poedit-Language: English\n"
|
14 |
+
"X-Poedit-Country: UNITED KINGDOM\n"
|
15 |
+
"X-Poedit-SourceCharset: utf-8\n"
|
16 |
+
"X-Poedit-KeywordsList: __;_e;__ngettext:1,2;_n:1,2;__ngettext_noop:1,2;_n_noop:1,2;_c,_nc:4c,1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;_nx_noop:4c,1,2;\n"
|
17 |
+
"X-Poedit-Basepath: \n"
|
18 |
+
"X-Poedit-Bookmarks: \n"
|
19 |
+
"X-Poedit-SearchPath-0: .\n"
|
20 |
+
"X-Textdomain-Support: yes"
|
21 |
+
|
22 |
+
#: wc-direct-checkout.php:113
|
23 |
+
#@ wc-direct-checkout
|
24 |
+
msgid "Direct Checkout"
|
25 |
+
msgstr ""
|
26 |
+
|
27 |
+
#: wc-direct-checkout.php:141
|
28 |
+
#@ wc-direct-checkout
|
29 |
+
msgid "You have saved WooCommerce Direct Checkout options."
|
30 |
+
msgstr ""
|
31 |
+
|
32 |
+
#: wc-direct-checkout.php:161
|
33 |
+
#@ wc-direct-checkout
|
34 |
+
msgid "Direct Checkout Options"
|
35 |
+
msgstr ""
|
36 |
+
|
37 |
+
#: wc-direct-checkout.php:177
|
38 |
+
#@ wc-direct-checkout
|
39 |
+
msgid "Enable"
|
40 |
+
msgstr ""
|
41 |
+
|
42 |
+
#: wc-direct-checkout.php:184
|
43 |
+
#@ wc-direct-checkout
|
44 |
+
msgid "Custom Add to Cart Text"
|
45 |
+
msgstr ""
|
46 |
+
|
47 |
+
#: wc-direct-checkout.php:194
|
48 |
+
#@ wc-direct-checkout
|
49 |
+
msgid "Save Options"
|
50 |
+
msgstr ""
|
51 |
+
|
languages/wc-direct-checkout-zh_CN.mo
ADDED
Binary file
|
languages/wc-direct-checkout-zh_CN.po
ADDED
@@ -0,0 +1,51 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
msgid ""
|
2 |
+
msgstr ""
|
3 |
+
"Project-Id-Version: WooCommerce Direct Checkout v1.0.0\n"
|
4 |
+
"Report-Msgid-Bugs-To: \n"
|
5 |
+
"POT-Creation-Date: \n"
|
6 |
+
"PO-Revision-Date: 2013-07-10 16:03:44+0000\n"
|
7 |
+
"Last-Translator: admin <terrytsang811@gmail.com>\n"
|
8 |
+
"Language-Team: \n"
|
9 |
+
"MIME-Version: 1.0\n"
|
10 |
+
"Content-Type: text/plain; charset=UTF-8\n"
|
11 |
+
"Content-Transfer-Encoding: 8bit\n"
|
12 |
+
"Plural-Forms: nplurals=2; plural=1;\n"
|
13 |
+
"X-Poedit-Language: Chinese\n"
|
14 |
+
"X-Poedit-Country: PEOPLE'S REPUBLIC OF CHINA\n"
|
15 |
+
"X-Poedit-SourceCharset: utf-8\n"
|
16 |
+
"X-Poedit-KeywordsList: __;_e;__ngettext:1,2;_n:1,2;__ngettext_noop:1,2;_n_noop:1,2;_c,_nc:4c,1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;_nx_noop:4c,1,2;\n"
|
17 |
+
"X-Poedit-Basepath: \n"
|
18 |
+
"X-Poedit-Bookmarks: \n"
|
19 |
+
"X-Poedit-SearchPath-0: .\n"
|
20 |
+
"X-Textdomain-Support: yes"
|
21 |
+
|
22 |
+
#: wc-direct-checkout.php:113
|
23 |
+
#@ wc-direct-checkout
|
24 |
+
msgid "Direct Checkout"
|
25 |
+
msgstr "直接结帐"
|
26 |
+
|
27 |
+
#: wc-direct-checkout.php:141
|
28 |
+
#@ wc-direct-checkout
|
29 |
+
msgid "You have saved WooCommerce Direct Checkout options."
|
30 |
+
msgstr "你成功储存直接结帐选项。"
|
31 |
+
|
32 |
+
#: wc-direct-checkout.php:161
|
33 |
+
#@ wc-direct-checkout
|
34 |
+
msgid "Direct Checkout Options"
|
35 |
+
msgstr "直接结帐选项"
|
36 |
+
|
37 |
+
#: wc-direct-checkout.php:177
|
38 |
+
#@ wc-direct-checkout
|
39 |
+
msgid "Enable"
|
40 |
+
msgstr "启用"
|
41 |
+
|
42 |
+
#: wc-direct-checkout.php:184
|
43 |
+
#@ wc-direct-checkout
|
44 |
+
msgid "Custom Add to Cart Text"
|
45 |
+
msgstr "自定义添加到购物车文字"
|
46 |
+
|
47 |
+
#: wc-direct-checkout.php:194
|
48 |
+
#@ wc-direct-checkout
|
49 |
+
msgid "Save Options"
|
50 |
+
msgstr "储存选项"
|
51 |
+
|
readme.txt
ADDED
@@ -0,0 +1,64 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
=== Plugin Name ===
|
2 |
+
Contributors: terrytsang
|
3 |
+
Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&business=terry@terrytsang.com&item_name=Donation+for+TerryTsang+Wordpress+WebDev
|
4 |
+
Plugin Name: WooCommerce Custom Direct Checkout
|
5 |
+
Plugin URI: http://terrytsang.com/shop/shop/woocommerce-direct-checkout/
|
6 |
+
Tags: woocommerce, custom fields, direct, checkout, e-commerce
|
7 |
+
Requires at least: 2.7
|
8 |
+
Tested up to: 3.5.2
|
9 |
+
Stable tag: 1.0.1
|
10 |
+
Version: 1.0.1
|
11 |
+
License: GPLv2 or later
|
12 |
+
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
13 |
+
|
14 |
+
You can skip shopping cart page and implement add to cart button redirect to checkout page. This can lead to an immediate increase in sales.
|
15 |
+
|
16 |
+
== Description ==
|
17 |
+
|
18 |
+
A WooCommerce plugin that aims to simplify the checkout process, leading to an immediate increase in sales.
|
19 |
+
|
20 |
+
In WooCommerce Settings Panel, there will be a new submenu link called 'Direct Checkout' where you can:
|
21 |
+
|
22 |
+
* Enabled / Disabled the direct checkout option
|
23 |
+
* Change "Add to cart" to any text
|
24 |
+
* Update "Redirect to Page" option
|
25 |
+
|
26 |
+
= Features =
|
27 |
+
|
28 |
+
* Implement add to cart button redirect to checkout page pattern
|
29 |
+
* 2 languages available : English UK (en_GB) and Chinese (zh_CN)
|
30 |
+
|
31 |
+
= IMPORTANT NOTES =
|
32 |
+
* This plugin requires the WooCommerce Extension.
|
33 |
+
* Do use POEdit and open 'wc-direct-checkout.pot' file and save the file as wc-direct-checkout-[language code].po, then put that into languages folder for this plugin.
|
34 |
+
|
35 |
+
= Additional Plugins by Terry Tsang =
|
36 |
+
* [Custom Checkout Options] (http://terrytsang.com/shop/shop/woocommerce-custom-checkout-options/)
|
37 |
+
* [Social Buttons PRO] (http://terrytsang.com/shop/shop/woocommerce-social-buttons-pro/)
|
38 |
+
|
39 |
+
|
40 |
+
== Installation ==
|
41 |
+
|
42 |
+
1. Upload the entire *woocommerce-direct-checkout* folder to the */wp-content/plugins/* directory
|
43 |
+
2. Activate the plugin through the 'Plugins' menu in WordPress
|
44 |
+
3. Go to WooCommerce Settings panel at left sidebar menu and update the options at Tab *Direct Checkout* there.
|
45 |
+
4. That's it. You're ready to go and cheers!
|
46 |
+
|
47 |
+
== Screenshots ==
|
48 |
+
|
49 |
+
1. [screenhot-1.png] Screenshot Admin WooCommerce Settings - Direct Checkout options
|
50 |
+
2. [screenhot-2.png] Screenshot Frontend WooCommerce - Catalog page
|
51 |
+
3. [screenhot-3.png] Screenshot Frontend WooCommerce - Product page
|
52 |
+
|
53 |
+
== Changelog ==
|
54 |
+
|
55 |
+
= 1.0.1 =
|
56 |
+
|
57 |
+
* Add 'Redirect to Page' option, let user choose redirecting to any page after add to cart pressed
|
58 |
+
* Updated wrong hyperlink
|
59 |
+
|
60 |
+
= 1.0.0 =
|
61 |
+
|
62 |
+
* Initial Release
|
63 |
+
* Customize add to cart text and change add to cart function directly to checkout page
|
64 |
+
|
screenshot-01.png
ADDED
Binary file
|
screenshot-02.png
ADDED
Binary file
|
screenshot-03.png
ADDED
Binary file
|
screenshot-1.png
ADDED
Binary file
|
screenshot-2.png
ADDED
Binary file
|
screenshot-3.png
ADDED
Binary file
|
wc-direct-checkout.php
ADDED
@@ -0,0 +1,269 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/*
|
3 |
+
Plugin Name: WooCommerce Direct Checkout
|
4 |
+
Plugin URI: http://terrytsang.com/shop/shop/woocommerce-direct-checkout/
|
5 |
+
Description: Allow you to implement direct checkout (skip cart page) for WooCommerce
|
6 |
+
Version: 1.0.1
|
7 |
+
Author: Terry Tsang
|
8 |
+
Author URI: http://shop.terrytsang.com
|
9 |
+
*/
|
10 |
+
|
11 |
+
/* Copyright 2012-2013 Terry Tsang (email: terrytsang811@gmail.com)
|
12 |
+
|
13 |
+
This program is free software; you can redistribute it and/or modify
|
14 |
+
it under the terms of the GNU General Public License as published by
|
15 |
+
the Free Software Foundation; either version 2 of the License, or
|
16 |
+
(at your option) any later version.
|
17 |
+
|
18 |
+
This program is distributed in the hope that it will be useful,
|
19 |
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
20 |
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
21 |
+
GNU General Public License for more details.
|
22 |
+
|
23 |
+
You should have received a copy of the GNU General Public License
|
24 |
+
along with this program; if not, write to the Free Software
|
25 |
+
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
26 |
+
*/
|
27 |
+
|
28 |
+
// Define plugin name
|
29 |
+
define('wc_plugin_name_direct_checkout', 'WooCommerce Direct Checkout');
|
30 |
+
|
31 |
+
// Define plugin version
|
32 |
+
define('wc_version_direct_checkout', '1.0.0');
|
33 |
+
|
34 |
+
|
35 |
+
// Checks if the WooCommerce plugins is installed and active.
|
36 |
+
if(in_array('woocommerce/woocommerce.php', apply_filters('active_plugins', get_option('active_plugins')))){
|
37 |
+
if(!class_exists('WooCommerce_Direct_Checkout')){
|
38 |
+
class WooCommerce_Direct_Checkout{
|
39 |
+
|
40 |
+
public static $plugin_prefix;
|
41 |
+
public static $plugin_url;
|
42 |
+
public static $plugin_path;
|
43 |
+
public static $plugin_basefile;
|
44 |
+
|
45 |
+
/**
|
46 |
+
* Gets things started by adding an action to initialize this plugin once
|
47 |
+
* WooCommerce is known to be active and initialized
|
48 |
+
*/
|
49 |
+
public function __construct(){
|
50 |
+
load_plugin_textdomain('wc-direct-checkout', false, dirname(plugin_basename(__FILE__)) . '/languages/');
|
51 |
+
|
52 |
+
WooCommerce_Direct_Checkout::$plugin_prefix = 'wc_direct_checkout_';
|
53 |
+
WooCommerce_Direct_Checkout::$plugin_basefile = plugin_basename(__FILE__);
|
54 |
+
WooCommerce_Direct_Checkout::$plugin_url = plugin_dir_url(WooCommerce_Direct_Checkout::$plugin_basefile);
|
55 |
+
WooCommerce_Direct_Checkout::$plugin_path = trailingslashit(dirname(__FILE__));
|
56 |
+
|
57 |
+
$this->textdomain = 'wc-direct-checkout';
|
58 |
+
|
59 |
+
$this->options_direct_checkout = array(
|
60 |
+
'direct_checkout_enabled' => '',
|
61 |
+
'direct_checkout_cart_button_text' => ''
|
62 |
+
);
|
63 |
+
|
64 |
+
$this->saved_options_direct_checkout = array();
|
65 |
+
|
66 |
+
add_action('woocommerce_init', array(&$this, 'init'));
|
67 |
+
}
|
68 |
+
|
69 |
+
/**
|
70 |
+
* Initialize extension when WooCommerce is active
|
71 |
+
*/
|
72 |
+
public function init(){
|
73 |
+
|
74 |
+
//add menu link for the plugin (backend)
|
75 |
+
add_action( 'admin_menu', array( &$this, 'add_menu_direct_checkout' ) );
|
76 |
+
|
77 |
+
if(get_option('direct_checkout_enabled'))
|
78 |
+
{
|
79 |
+
//unset all related options to disabled / not active
|
80 |
+
update_option('woocommerce_cart_redirect_after_add', 'no');
|
81 |
+
update_option('woocommerce_enable_ajax_add_to_cart', 'no');
|
82 |
+
|
83 |
+
add_filter('add_to_cart_redirect', array( &$this, 'custom_add_to_cart_redirect') );
|
84 |
+
add_filter('single_add_to_cart_text', array( &$this, 'custom_cart_button_text') );
|
85 |
+
add_filter('add_to_cart_text', array( &$this, 'custom_cart_button_text') );
|
86 |
+
}
|
87 |
+
}
|
88 |
+
|
89 |
+
/**
|
90 |
+
* Set custom add to cart redirect
|
91 |
+
*/
|
92 |
+
function custom_add_to_cart_redirect() {
|
93 |
+
|
94 |
+
return get_permalink(get_option('woocommerce_checkout_page_id')); // Replace with the url of your choosing
|
95 |
+
}
|
96 |
+
|
97 |
+
/**
|
98 |
+
* Set custom add to cart text
|
99 |
+
*/
|
100 |
+
function custom_cart_button_text() {
|
101 |
+
$direct_checkout_cart_button_text = get_option( 'direct_checkout_cart_button_text' ) ? get_option( 'direct_checkout_cart_button_text' ) : "Add to cart";
|
102 |
+
|
103 |
+
if($direct_checkout_cart_button_text && $direct_checkout_cart_button_text != "")
|
104 |
+
return __($direct_checkout_cart_button_text, $this->textdomain);
|
105 |
+
|
106 |
+
}
|
107 |
+
|
108 |
+
/**
|
109 |
+
* Add a menu link to the woocommerce section menu
|
110 |
+
*/
|
111 |
+
function add_menu_direct_checkout() {
|
112 |
+
$wc_page = 'woocommerce';
|
113 |
+
$comparable_settings_page = add_submenu_page( $wc_page , __( 'Direct Checkout', $this->textdomain ), __( 'Direct Checkout', $this->textdomain ), 'manage_options', 'wc-direct-checkout', array(
|
114 |
+
&$this,
|
115 |
+
'settings_page_direct_checkout'
|
116 |
+
));
|
117 |
+
}
|
118 |
+
|
119 |
+
/**
|
120 |
+
* Create the settings page content
|
121 |
+
*/
|
122 |
+
public function settings_page_direct_checkout() {
|
123 |
+
|
124 |
+
// If form was submitted
|
125 |
+
if ( isset( $_POST['submitted'] ) )
|
126 |
+
{
|
127 |
+
check_admin_referer( $this->textdomain );
|
128 |
+
|
129 |
+
$this->saved_options_direct_checkout['direct_checkout_enabled'] = ! isset( $_POST['direct_checkout_enabled'] ) ? '1' : $_POST['direct_checkout_enabled'];
|
130 |
+
$this->saved_options_direct_checkout['direct_checkout_cart_button_text'] = ! isset( $_POST['direct_checkout_cart_button_text'] ) ? 'Add to cart' : $_POST['direct_checkout_cart_button_text'];
|
131 |
+
|
132 |
+
foreach($this->options_direct_checkout as $field => $value)
|
133 |
+
{
|
134 |
+
$option_direct_checkout = get_option( $field );
|
135 |
+
|
136 |
+
if($option_direct_checkout != $this->saved_options_direct_checkout[$field])
|
137 |
+
update_option( $field, $this->saved_options_direct_checkout[$field] );
|
138 |
+
}
|
139 |
+
|
140 |
+
// Show message
|
141 |
+
echo '<div id="message" class="updated fade"><p>' . __( 'You have saved WooCommerce Direct Checkout options.', $this->textdomain ) . '</p></div>';
|
142 |
+
}
|
143 |
+
|
144 |
+
$direct_checkout_enabled = get_option( 'direct_checkout_enabled' );
|
145 |
+
$direct_checkout_cart_button_text = get_option( 'direct_checkout_cart_button_text' );
|
146 |
+
|
147 |
+
$checked = '';
|
148 |
+
|
149 |
+
if($direct_checkout_enabled)
|
150 |
+
$checked = 'checked="checked"';
|
151 |
+
|
152 |
+
|
153 |
+
$actionurl = $_SERVER['REQUEST_URI'];
|
154 |
+
$nonce = wp_create_nonce( $this->textdomain );
|
155 |
+
|
156 |
+
|
157 |
+
// Configuration Page
|
158 |
+
|
159 |
+
?>
|
160 |
+
<div id="icon-options-general" class="icon32"></div>
|
161 |
+
<h3><?php _e( 'Direct Checkout Options', $this->textdomain); ?></h3>
|
162 |
+
|
163 |
+
|
164 |
+
<table width="90%" cellspacing="2">
|
165 |
+
<tr>
|
166 |
+
<td colspan="2">Checking out is the most important and key part of placing an order online, and many users end up abandoning their order at the end. This plugin will simplify the checkout process, leading to an immediate increase in sales.</td>
|
167 |
+
</tr>
|
168 |
+
<tr>
|
169 |
+
<td width="70%" valign="top">
|
170 |
+
<form action="<?php echo $actionurl; ?>" method="post">
|
171 |
+
<table>
|
172 |
+
<tbody>
|
173 |
+
<tr>
|
174 |
+
<td colspan="2">
|
175 |
+
<table class="widefat fixed" cellspacing="2" cellpadding="5" border="0">
|
176 |
+
<tr>
|
177 |
+
<td width="25%"><?php _e( 'Enable', $this->textdomain ); ?></td>
|
178 |
+
<td>
|
179 |
+
<input class="checkbox" name="direct_checkout_enabled" id="direct_checkout_enabled" value="0" type="hidden">
|
180 |
+
<input class="checkbox" name="direct_checkout_enabled" id="direct_checkout_enabled" value="1" type="checkbox" <?php echo $checked; ?> type="checkbox">
|
181 |
+
</td>
|
182 |
+
</tr>
|
183 |
+
<tr>
|
184 |
+
<td width="25%"><?php _e( 'Custom Add to Cart Text', $this->textdomain ); ?></td>
|
185 |
+
<td>
|
186 |
+
<input name="direct_checkout_cart_button_text" id="direct_checkout_cart_button_text" value="<?php echo $direct_checkout_cart_button_text; ?>" />
|
187 |
+
</td>
|
188 |
+
</tr>
|
189 |
+
</table>
|
190 |
+
</td>
|
191 |
+
</tr>
|
192 |
+
<tr>
|
193 |
+
<td colspan=2">
|
194 |
+
<input class="button-primary" type="submit" name="Save" value="<?php _e('Save Options', $this->textdomain); ?>" id="submitbutton" />
|
195 |
+
<input type="hidden" name="submitted" value="1" />
|
196 |
+
<input type="hidden" id="_wpnonce" name="_wpnonce" value="<?php echo $nonce; ?>" />
|
197 |
+
</td>
|
198 |
+
</tr>
|
199 |
+
</tbody>
|
200 |
+
</table>
|
201 |
+
</form>
|
202 |
+
|
203 |
+
</td>
|
204 |
+
|
205 |
+
<td width="30%" style="background:#ececec;padding:10px 5px;" valign="top">
|
206 |
+
<p><b>WooCommerce Direct Checkout</b> is a FREE woocommerce plugin developed by <a href="http://shop.terrytsang.com" target="_blank" title="Terry Tsang - a PHP Developer and Wordpress Consultant">Terry Tsang</a>. This plugin aims to add direct checkout for WooCommerce.</p>
|
207 |
+
|
208 |
+
<h3>Get More Plugins</h3>
|
209 |
+
|
210 |
+
<p><a href="http://shop.terrytsang.com" target="_blank" title="Premium & Free Extensions/Plugins for E-Commerce by Terry Tsang">Go to My Site</a> to get more free and premium extensions/plugins for your ecommerce sites.</p>
|
211 |
+
|
212 |
+
<h3>Spreading the Word</h3>
|
213 |
+
|
214 |
+
<ul style="list-style:dash">If you find this plugin helpful, you can:
|
215 |
+
<li>- Write and review about it in your blog</li>
|
216 |
+
<li>- Rate it on <a href="http://wordpress.org/extend/plugins/woocommerce-facebook-share-like-button/" target="_blank">wordpress plugin page</a></li>
|
217 |
+
<li>- Share on your social media<br />
|
218 |
+
<a href="http://www.facebook.com/sharer.php?u=http://terrytsang.com/shop/shop/woocommerce-direct-checkout/&t=WooCommerce Direct Checkout" title="Share this WooCommerce Direct Checkout on Facebook" target="_blank"><img src="http://terrytsang.com/shop/images/social_facebook.png" alt="Share this WooCommerce Direct Checkout plugin on Facebook"></a>
|
219 |
+
<a href="https://twitter.com/intent/tweet?url=http%3A%2F%2Fterrytsang.com%2Fshop%2Fshop%2Fwoocommerce-facebook-share-like-button%2F&text=WooCommerce Direct Checkout - &via=terrytsang811" target="_blank"><img src="http://terrytsang.com/shop/images/social_twitter.png" alt="Tweet about WooCommerce Direct Checkout plugin"></a>
|
220 |
+
<a href="http://linkedin.com/shareArticle?mini=true&url=http://terrytsang.com/shop/shop/woocommerce-direct-checkout/&title=WooCommerce Direct Checkout plugin" title="Share this WooCommerce Direct Checkout plugin on LinkedIn" target="_blank"><img src="http://terrytsang.com/shop/images/social_linkedin.png" alt="Share this WooCommerce Direct Checkout plugin on LinkedIn"></a>
|
221 |
+
</li>
|
222 |
+
<li>- Or make a donation</li>
|
223 |
+
</ul>
|
224 |
+
|
225 |
+
<a href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=LJWSJDBBLNK7W" target="_blank"><img src="https://www.paypal.com/en_US/i/btn/btn_donate_LG.gif" border="0" alt="" /></a>
|
226 |
+
|
227 |
+
<h3>Thank you for your support!</h3>
|
228 |
+
</td>
|
229 |
+
|
230 |
+
</tr>
|
231 |
+
</table>
|
232 |
+
|
233 |
+
|
234 |
+
<br />
|
235 |
+
|
236 |
+
<?php
|
237 |
+
}
|
238 |
+
|
239 |
+
/**
|
240 |
+
* Get the setting options
|
241 |
+
*/
|
242 |
+
function get_options() {
|
243 |
+
|
244 |
+
foreach($this->options_direct_checkout as $field => $value)
|
245 |
+
{
|
246 |
+
$array_options[$field] = get_option( $field );
|
247 |
+
}
|
248 |
+
|
249 |
+
return $array_options;
|
250 |
+
}
|
251 |
+
|
252 |
+
|
253 |
+
}//end class
|
254 |
+
|
255 |
+
}//if class does not exist
|
256 |
+
|
257 |
+
$woocommerce_direct_checkout = new WooCommerce_Direct_Checkout();
|
258 |
+
}
|
259 |
+
else{
|
260 |
+
add_action('admin_notices', 'wc_direct_checkout_error_notice');
|
261 |
+
function wc_direct_checkout_error_notice(){
|
262 |
+
global $current_screen;
|
263 |
+
if($current_screen->parent_base == 'plugins'){
|
264 |
+
echo '<div class="error"><p>'.__(wc_plugin_name_direct_checkout.' requires <a href="http://www.woothemes.com/woocommerce/" target="_blank">WooCommerce</a> to be activated in order to work. Please install and activate <a href="'.admin_url('plugin-install.php?tab=search&type=term&s=WooCommerce').'" target="_blank">WooCommerce</a> first.').'</p></div>';
|
265 |
+
}
|
266 |
+
}
|
267 |
+
}
|
268 |
+
|
269 |
+
?>
|
wc-direct-checkout.pot
ADDED
@@ -0,0 +1,51 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
msgid ""
|
2 |
+
msgstr ""
|
3 |
+
"Project-Id-Version: WooCommerce Direct Checkout v1.0.0\n"
|
4 |
+
"Report-Msgid-Bugs-To: \n"
|
5 |
+
"POT-Creation-Date: \n"
|
6 |
+
"PO-Revision-Date: 2013-07-10 15:54:14+0000\n"
|
7 |
+
"Last-Translator: admin <terrytsang811@gmail.com>\n"
|
8 |
+
"Language-Team: \n"
|
9 |
+
"MIME-Version: 1.0\n"
|
10 |
+
"Content-Type: text/plain; charset=UTF-8\n"
|
11 |
+
"Content-Transfer-Encoding: 8bit\n"
|
12 |
+
"Plural-Forms: nplurals=2; plural=n != 1;\n"
|
13 |
+
"X-Poedit-Language: English\n"
|
14 |
+
"X-Poedit-Country: UNITED KINGDOM\n"
|
15 |
+
"X-Poedit-SourceCharset: utf-8\n"
|
16 |
+
"X-Poedit-KeywordsList: __;_e;__ngettext:1,2;_n:1,2;__ngettext_noop:1,2;_n_noop:1,2;_c,_nc:4c,1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;_nx_noop:4c,1,2;\n"
|
17 |
+
"X-Poedit-Basepath: \n"
|
18 |
+
"X-Poedit-Bookmarks: \n"
|
19 |
+
"X-Poedit-SearchPath-0: .\n"
|
20 |
+
"X-Textdomain-Support: yes"
|
21 |
+
|
22 |
+
#: wc-direct-checkout.php:113
|
23 |
+
#@ wc-direct-checkout
|
24 |
+
msgid "Direct Checkout"
|
25 |
+
msgstr ""
|
26 |
+
|
27 |
+
#: wc-direct-checkout.php:141
|
28 |
+
#@ wc-direct-checkout
|
29 |
+
msgid "You have saved WooCommerce Direct Checkout options."
|
30 |
+
msgstr ""
|
31 |
+
|
32 |
+
#: wc-direct-checkout.php:161
|
33 |
+
#@ wc-direct-checkout
|
34 |
+
msgid "Direct Checkout Options"
|
35 |
+
msgstr ""
|
36 |
+
|
37 |
+
#: wc-direct-checkout.php:177
|
38 |
+
#@ wc-direct-checkout
|
39 |
+
msgid "Enable"
|
40 |
+
msgstr ""
|
41 |
+
|
42 |
+
#: wc-direct-checkout.php:184
|
43 |
+
#@ wc-direct-checkout
|
44 |
+
msgid "Custom Add to Cart Text"
|
45 |
+
msgstr ""
|
46 |
+
|
47 |
+
#: wc-direct-checkout.php:194
|
48 |
+
#@ wc-direct-checkout
|
49 |
+
msgid "Save Options"
|
50 |
+
msgstr ""
|
51 |
+
|