Plugin Directory

Changeset 1045306


Ignore:
Timestamp:
12/15/2014 10:45:45 PM (11 years ago)
Author:
Rashef
Message:

Resolved PHP Notices and Warnings. Added compatibility with WooCommerce Product Bundles.

Location:
woocommerce-autocomplete-order/tags/1.0
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • woocommerce-autocomplete-order/tags/1.0/readme.txt

    r1025646 r1045306  
    44Tags: WooCommerce, order, complete, virtual, autocomplete
    55Requires at least: 3.3
    6 Tested up to: 4.0.0
    7 Stable tag: 1.0
     6Tested up to: 4.0.1
     7Stable tag: 1.1
    88License: GNU General Public License v3.0
    99License URI: http://www.gnu.org/licenses/gpl-3.0.html
     
    1414
    1515WooCommerce by design allows to automatically mark as "Compelted" only orders for products marked as both "Virtual" and "Downloadable". This plugin actually extend this feature through 3 different modes:
    16 
    17 * Virtual Paid Products Only: order for products marked as "Virtual" will be turned to "Completed" upon successfull payment.     
    18 * All Paid Products: orders for any product are turned to "Completed" upon successfull payment.     
    19 * All Products: each and every order is turned to "Completed" irrespective for the payment method and whether or not the payment happened.     
     16    * Virtual Paid Products Only: order for products marked as "Virtual" will be turned to "Completed" upon successfull payment.     
     17    * All Paid Products: orders for any product are turned to "Completed" upon successfull payment.     
     18    * All Products: each and every order is turned to "Completed" irrespective for the payment method and whether or not the payment happened.     
    2019Please be aware that the third mode allows the customer to immediately access the product (if downloadable, for example) whether or not the payment was performed.
    2120
    2221== Installation ==
    2322
     231. Ensure you have WooCommerce 2.1 or higher installed and active
    24241. Upload the plugin's folder to the `/wp-content/plugins/` directory
    25251. Activate the plugin through the 'Plugins' menu in WordPress
    26 1. Flag as "Virtual" all the products you want to be unlocked for users upon successful payment without any further (manual) action from you in the backoffice
     261. Open WooCommerce > Settings > Woo Extra Options
     271. Pick an option from the dropdown within the section named "Autocomplete Orders"
    2728
    2829== Screenshots ==
     
    3435
    3536= The plugin is not working =
    36 Please ensure that you picked the right mode from the list.     
     37Please verify the following:   
     38    * Ensure that WooCommerce is installed and active     
     39    * Ensure that you picked from the list the mode that fits your needs           
    3740
    3841= Uh-uh, still not working! =
     
    4245Please deactivate my plugin (or select mode "Off"), test with a product marked as "virtual" and "downloadable". If it still doesn't work, then there's something wrong in your WooCommerce configuration or in your payment gateway. If it does work, please write me through the forum!       
    4346
     47= How can I make it work with WooCommerce Product Bundles? =
     48If you want to use mode "Virtual Paid Products Only" ensure that the bundle has the flag "Non-bundles Shipping" checked
     49
    4450== Changelog ==
    4551
     52= 1.1 =
     53    * Added compatibility with WooCommerce Product Bundles
     54    * Fixed PHP Warning and Notices
     55
    4656= 1.0 =
    47 * Plugin completely rewritten to comply with WordPress 4.0 and WooCommerce 2.0.     
    48 * Added 3 different modes to ativate the plugin:       
    49 ** Virtual Paid Products Only: order for products marked as "Virtual" will be turned to "Completed" upon successfull payment.           
    50 ** All Paid Products: orders for any product are turned to "Completed" upon successfull payment.     
    51 ** All Products: each and every order is turned to "Completed" irrespective for the payment method and whether or not the payment happened.     
    52 * Added a settings page (in WooCommerce dashboard) to select the mode we want to activate (under WooCommerce > Settings > Woo Extra Options).     
    5357   
    5458= v0.1.2 =
    55 * Updated compatibility.     
    56 * Added localization support.     
    57 * Added Italian localization.     
    58 * Added Spanish localization.     
     59    * Updated compatibility.     
     60    * Added localization support.     
     61    * Added Italian localization.     
     62    * Added Spanish localization.     
    5963
    6064= v0.1.1 =
    61 * Added links to support and the official page.     
     65    * Added links to support and the official page.     
    6266   
    6367= v0.1 =
    64 * First release.     
     68    * First release.     
    6569
    6670== Upgrade notice ==
    6771
    68 The plugin has been completely rewritten to meet requirements for WP4 and WooCommerce 2.0.     
    69 A new tab has been added to WooCommerce settings in the Dashboard to select in which mode you want the plugin to work:   
    70 * autocomplete only orders for virtual product     
    71 * autocomplete every order once paid     
    72 * autocomplete every order even if not paid     
    73 Enjoy!
  • woocommerce-autocomplete-order/tags/1.0/woocommerce-autocomplete-order.php

    r1025567 r1045306  
    44    Plugin URI:
    55    Description: Do you hate WooCommerce for obliging you to manually approve every order placed for non-downloadable goods? This plugin is the answer, since allows to automatically mark orders for **virtual** products as Completed after a successful payment (e.g. with PayPal or Credit Card).
    6     Version: 1.0
     6    Version: 1.1
    77    Author: Mirko Grewing
    88    Author URI: http://www.mirkogrewing.it 
     
    1414
    1515if (in_array('woocommerce/woocommerce.php', apply_filters('active_plugins', get_option('active_plugins')))) {
    16     load_plugin_textdomain('wooExtraOptions', false, dirname(plugin_basename(__FILE__)) . '/languages/');
    17     if (!class_exists('MG_Woo_Extra_Options')) {
    18         /**
    19         * MG_Woo_Extra_Options
    20         */
    21         class MG_Woo_Extra_Options
    22         {
    23             /**
    24              * $id
    25              * holds settings tab id
    26              * @var string
    27              */
    28             public $id = 'mg_woo_eo';
    29 
    30             /**
    31             * __construct
    32             * class constructor will set the needed filter and action hooks
    33             */
    34             function __construct()
    35             {
    36                 //add settings tab
    37                 add_filter( 'woocommerce_settings_tabs_array', array($this,'woocommerce_settings_tabs_array'), 50 );
    38                 //show settings tab
    39                 add_action( 'woocommerce_settings_tabs_'.$this->id, array($this,'show_settings_tab' ));
    40                 //save settings tab
    41                 add_action( 'woocommerce_update_options_'.$this->id, array($this,'update_settings_tab' ));
    42                 //add tabs select field
    43                 add_action('woocommerce_admin_field_'.$this->post_type,array($this,'show_'.$this->post_type.'_field' ),10);
    44                 //save tabs select field
    45                 add_action( 'woocommerce_update_option_'.$this->post_type,array($this,'save_'.$this->post_type.'_field' ),10);
    46                 //ajax search handler
    47                 //add_action('wp_ajax_woocommerce_json_custom_tabs', array($this,'woocommerce_json_custom_tabs'));
    48                 //register_post_type
    49                 add_action( 'init', array($this,'autocompleteOrders'), 0 );
    50             }
     16    load_plugin_textdomain('wooExtraOptions', false, dirname(plugin_basename(__FILE__)) . '/languages/');
     17    if (!class_exists('MG_Woo_Extra_Options')) {
     18        /**
     19         * Main Loader Class
     20         * Used to extend WooCommerce settings.
     21         *
     22         * @category  Class
     23         * @package   Woocommerce_Autocomplete_Order
     24         * @author    Mirko Grewing <mirko@grewing.co.uk>
     25         * @copyright 2014 Mirko Grewing
     26         * @license   http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License v3.0
     27         * @version   1.1
     28         * @link      http://www.nitelab.org/
     29         * @since     Class available since Release 0.1
     30         *
     31         */
     32        class MG_Woo_Extra_Options
     33        {
     34            /**
     35             * $id
     36             * holds settings tab id
     37             * @var string
     38             */
     39            public $id = 'mg_woo_eo';
     40           
     41            /**
     42             * __construct
     43             * class constructor will set the needed filter and action hooks
     44             */
     45            function __construct()
     46            {
     47                if (is_admin()) {
     48                    //add settings tab
     49                    add_filter('woocommerce_settings_tabs_array', array($this,'woocommerce_settings_tabs_array'), 50);
     50                    //show settings tab
     51                    add_action('woocommerce_settings_tabs_'.$this->id, array($this,'show_settings_tab'));
     52                    //save settings tab
     53                    add_action('woocommerce_update_options_'.$this->id, array($this,'update_settings_tab'));
     54                    //add tabs select field
     55                    add_action('woocommerce_admin_field_'.$this->id,array($this, 'show_'.$this->id.'_field'), 10);
     56                    //save tabs select field
     57                    add_action('woocommerce_update_option_'.$this->id,array($this, 'save_'.$this->id.'_field'), 10);
     58                }
     59                //ajax search handler
     60                //add_action('wp_ajax_woocommerce_json_custom_tabs', array($this,'woocommerce_json_custom_tabs'));
     61                //register_post_type
     62                add_action('init', array($this,'autocompleteOrders'), 0);
     63            }
    5164
    5265            /**
     
    93106                    ),
    94107                    'title' => array(
    95                         'name'     => __( 'Mode', 'wooExtraOptions' ),
     108                        'name'     => __('Mode', 'wooExtraOptions'),
    96109                        'type'     => 'select',
    97                         'desc'     => __( 'Select the type of autocompletion you want to activate.', 'wooExtraOptions' ),
     110                        'desc'     => __('Select the type of autocompletion you want to activate.', 'wooExtraOptions'),
    98111                        'desc_tip' => true,
    99112                        'default'  => 'off',
     
    139152                    }
    140153                } elseif ($mode == 'paid') {
    141                     add_filter( 'woocommerce_payment_complete_order_status', 'autocompletePaidOrders', 10, 2 );
     154                    add_filter('woocommerce_payment_complete_order_status', 'autocompletePaidOrders', 10, 2);
    142155                    /**
    143156                     * autocompletePaidOrders
     
    154167                    }
    155168                } elseif ($mode == 'virtual') {
    156                     add_filter( 'woocommerce_payment_complete_order_status', 'autocompleteVirtualOrders', 10, 2 );
     169                    add_filter('woocommerce_payment_complete_order_status', 'autocompleteVirtualOrders', 10, 2);
    157170                    /**
    158171                     * autocompleteVirtualOrders
     
    189202        new MG_Woo_Extra_Options();
    190203    }
     204} elseif (defined('WOOCOMMERCE_VERSION') && version_compare(WOOCOMMERCE_VERSION, '2.1', '<')) {
     205    wc_add_notice(sprintf(__("This plugin requires WooCommerce 2.1 or higher!", "wooExtraOptions" ), 'error'));
    191206} else {
    192207    /**
Note: See TracChangeset for help on using the changeset viewer.