WordPress.org

Plugin Directory

Changeset 1736369


Ignore:
Timestamp:
09/26/17 14:54:04 (3 months ago)
Author:
sormano
Message:

WAFS 1.1.3

Location:
woocommerce-advanced-free-shipping
Files:
6 deleted
11 edited
55 copied

Legend:

Unmodified
Added
Removed
  • woocommerce-advanced-free-shipping/tags/1.1.3/includes/admin/class-wafs-admin.php

    r1647397 r1736369  
    1919     * @since 1.0.8 
    2020     */ 
    21     public function __construct() {} 
     21    public function __construct() { 
     22        // Initialize class 
     23        add_action( 'admin_init', array( $this, 'init' ) ); 
     24    } 
    2225 
    2326 
  • woocommerce-advanced-free-shipping/tags/1.1.3/includes/class-wafs-post-type.php

    r1609491 r1736369  
    136136        add_meta_box( 'wafs_conditions', __( 'Advanced Free Shipping conditions', 'woocommerce-advanced-free-shipping' ), array( $this, 'render_wafs_conditions' ), 'wafs', 'normal' ); 
    137137        add_meta_box( 'wafs_settings', __( 'Shipping settings', 'woocommerce-advanced-free-shipping' ), array( $this, 'render_wafs_settings' ), 'wafs', 'normal' ); 
     138        add_meta_box( 'wafs_resources', __( 'Useful links', 'woocommerce-advanced-free-shipping' ), array( $this, 'render_wafs_resources' ), 'wafs', 'side' ); 
    138139 
    139140    } 
     
    161162    public function render_wafs_settings() { 
    162163        require_once plugin_dir_path( __FILE__ ) . 'admin/views/meta-box-settings.php'; 
     164    } 
     165 
     166 
     167    /** 
     168     * Show resources MB contents. 
     169     * 
     170     * @since 1.1.3 
     171     */ 
     172    function render_wafs_resources() { 
     173 
     174        ?><ul> 
     175            <li><a href="http://jeroensormani.com/how-the-advanced-plugin-conditions-work?utm_source=WAFS-plugin&utm_medium=website&utm_campaign=WAFS-helpful-links" target="_blank"><?php _e( 'How the conditions work', 'woocommerce-advanced-free-shipping' ); ?></a></li> 
     176            <li><a href="http://jeroensormani.com/apply-free-shipping-for-specific-products-in-woocommerce?utm_source=WAFS-plugin&utm_medium=website&utm_campaign=WAFS-helpful-links" target="_blank"><?php _e( 'Applying free shipping to specific products', 'woocommerce-advanced-free-shipping' ); ?></a></li> 
     177            <li><a href="http://jeroensormani.com/showing-add-10-free-shipping-notice#showing-a-free-shipping-notice-for-advanced-shipping?utm_source=WAFS-plugin&utm_medium=website&utm_campaign=WAFS-helpful-links" target="_blank"><?php _e( 'Showing a free shipping message', 'woocommerce-advanced-free-shipping' ); ?></a></li> 
     178            <li><a href="http://jeroensormani.com/shipping-debug-mode?utm_source=WAFS-plugin&utm_medium=website&utm_campaign=WAFS-helpful-links" target="_blank"><?php _e( 'Disabling the shipping cache', 'woocommerce-advanced-free-shipping' ); ?></a></li> 
     179            <li><a href="http://codecanyon.net/item/woocommerce-advanced-shipping/8634573" target="_blank"><?php _e( 'Apply shipping cost using conditions', 'woocommerce-advanced-free-shipping' ); ?></a></li> 
     180            <hr /> 
     181            <li><a href="http://jeroensormani.com/contact?utm_source=WAFS-plugin&utm_medium=website&utm_campaign=WAFS-helpful-links" target="_blank"><?php _e( 'Hire me for custom condition development', 'woocommerce-advanced-free-shipping' ); ?></a></li> 
     182        </ul><?php 
     183 
    163184    } 
    164185 
  • woocommerce-advanced-free-shipping/tags/1.1.3/libraries/wp-conditions/conditions/wpc-shipping-method-condition.php

    r1609491 r1736369  
    5959 
    6060            $shipping_options = array(); 
    61             foreach ( WC()->shipping->load_shipping_methods() as $method ) : 
    62                 $shipping_options['Methods'][ $method->id ] = $method->get_title(); 
     61            foreach ( WC()->shipping()->load_shipping_methods() as $method ) : 
     62                $shipping_options['Methods'][ $method->id ] = $method->get_method_title(); 
    6363            endforeach; 
    6464 
  • woocommerce-advanced-free-shipping/tags/1.1.3/libraries/wp-conditions/conditions/wpc-subtotal-ex-tax-condition.php

    r1609491 r1736369  
    2020 
    2121        public function get_compare_value() { 
     22            if ( method_exists( WC()->cart, 'get_subtotal' ) ) { // WC 3.2+ 
     23                return WC()->cart->get_subtotal(); 
     24            } 
     25 
    2226            return WC()->cart->subtotal_ex_tax; 
    2327        } 
  • woocommerce-advanced-free-shipping/tags/1.1.3/libraries/wp-conditions/conditions/wpc-tax-condition.php

    r1609491 r1736369  
    2020 
    2121        public function get_compare_value() { 
     22            if ( method_exists( WC()->cart, 'get_cart_contents_tax' ) ) { // WC 3.2+ 
     23                return WC()->cart->get_cart_contents_tax(); 
     24            } 
     25 
    2226            return array_sum( (array) WC()->cart->taxes ); 
    2327        } 
  • woocommerce-advanced-free-shipping/tags/1.1.3/libraries/wp-conditions/readme.txt

    r1687709 r1736369  
    55 
    66 
    7 # Current version: 1.0.3 
     7# Current version: 1.0.5 
    88 
    99# Changelog 
     10 
     11= 1.0.5 - 26/09/2017 = 
     12 
     13- [Improvement] - WC 3.2 changes to prevent notices 
     14 
     15= 1.0.4 - 01/09/2017 = 
     16 
     17- [Improvement] - Use WC_Method:get_method_title() instead of get_title() to get method title. 
    1018 
    1119= 1.0.3 - 28/06/2017 = 
  • woocommerce-advanced-free-shipping/tags/1.1.3/readme.txt

    r1687709 r1736369  
    44Requires at least: 4.0 
    55Tested up to: 4.8 
    6 Stable tag: 1.1.2 
     6Stable tag: 1.1.3 
     7Requires PHP: 5.3 
    78License: GPLv3 or later 
    89License URI: http://www.gnu.org/licenses/gpl-3.0.html 
     
    101102== Changelog == 
    102103 
     104= 1.1.3 - 26-09-2017 = 
     105 
     106* [Add] - Helpful resources meta box 
     107* [Tested] - WooCommerce 3.2 
     108* [Improvement] - Update WP Conditions to 1.0.5 
     109        - [Improvement] - WC 3.2 changes to prevent notices 
     110        = 1.0.4 = 
     111        - [Improvement] - Use WC_Method:get_method_title() instead of get_title() to get method title. 
     112 
     113 
    103114= 1.1.2 - 29-06-2017 = 
    104115 
  • woocommerce-advanced-free-shipping/tags/1.1.3/woocommerce-advanced-free-shipping.php

    r1687709 r1736369  
    44 * Plugin URI:      https://wordpress.org/plugins/woocommerce-advanced-free-shipping/ 
    55 * Description:     WooCommerce Advanced Free Shipping is an plugin which allows you to set up advanced free shipping conditions. 
    6  * Version:         1.1.2 
     6 * Version:         1.1.3 
    77 * Author:          Jeroen Sormani 
    88 * Author URI:      http://jeroensormani.com/ 
    99 * Text Domain:     woocommerce-advanced-free-shipping 
     10 * WC requires at least: 3.0.0 
     11 * WC tested up to:      3.2.0 
    1012 
    1113 * Copyright Jeroen Sormani 
     
    4951     * @var string $version Plugin version number. 
    5052     */ 
    51     public $version = '1.1.2'; 
     53    public $version = '1.1.3'; 
    5254 
    5355 
     
    7880    public function __construct() { 
    7981 
    80         if ( ! function_exists( 'is_plugin_active_for_network' ) ) { 
    81             require_once( ABSPATH . '/wp-admin/includes/plugin.php' ); 
     82        // Check if WooCommerce is active 
     83        require_once( ABSPATH . '/wp-admin/includes/plugin.php' ); 
     84        if ( ! is_plugin_active( 'woocommerce/woocommerce.php' ) && ! function_exists( 'WC' ) ) { 
     85            return; 
    8286        } 
    8387 
    84         // Check if WooCommerce is active 
    85         if ( ! in_array( 'woocommerce/woocommerce.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) ) ) : 
    86             if ( ! is_plugin_active_for_network( 'woocommerce/woocommerce.php' ) ) : 
    87                 return; 
    88             endif; 
    89         endif; 
     88        $this->init(); 
    9089 
    9190    } 
     
    164163            require_once plugin_dir_path( __FILE__ ) . 'includes/admin/class-wafs-admin.php'; 
    165164            $this->admin = new WAFS_Admin(); 
    166             $this->admin->init(); 
    167165        endif; 
    168166 
     
    282280 
    283281        ?><div class='updated'> 
    284         <p><?php echo sprintf( __( 'Advanced Free Shipping requires PHP 5.3 or higher and your current PHP version is %s. Please (contact your host to) update your PHP version.', 'woocommerce-advanced-messages' ), PHP_VERSION ); ?></p> 
     282            <p><?php echo sprintf( __( 'Advanced Free Shipping requires PHP 5.3 or higher and your current PHP version is %s. Please (contact your host to) update your PHP version.', 'woocommerce-advanced-messages' ), PHP_VERSION ); ?></p> 
    285283        </div><?php 
    286284 
     
    290288 
    291289 
    292 /** 
    293  * The main function responsible for returning the WooCommerce_Advanced_Free_Shipping object. 
    294  * 
    295  * Use this function like you would a global variable, except without needing to declare the global. 
    296  * 
    297  * Example: <?php WAFS()->method_name(); ?> 
    298  * 
    299  * @since 1.1.0 
    300  * 
    301  * @return  object  WooCommerce_Advanced_Free_Shipping class object. 
    302  */ 
    303290if ( ! function_exists( 'WAFS' ) ) : 
    304291 
     292    /** 
     293     * The main function responsible for returning the WooCommerce_Advanced_Free_Shipping object. 
     294     * 
     295     * Use this function like you would a global variable, except without needing to declare the global. 
     296     * 
     297     * Example: <?php WAFS()->method_name(); ?> 
     298     * 
     299     * @since 1.1.0 
     300     * 
     301     * @return  object  WooCommerce_Advanced_Free_Shipping class object. 
     302     */ 
    305303    function WAFS() { 
    306304 
     
    312310endif; 
    313311 
    314 WAFS()->init(); 
     312WAFS(); 
  • woocommerce-advanced-free-shipping/trunk/includes/admin/class-wafs-admin.php

    r1647397 r1736369  
    1919     * @since 1.0.8 
    2020     */ 
    21     public function __construct() {} 
     21    public function __construct() { 
     22        // Initialize class 
     23        add_action( 'admin_init', array( $this, 'init' ) ); 
     24    } 
    2225 
    2326 
  • woocommerce-advanced-free-shipping/trunk/includes/class-wafs-post-type.php

    r1609491 r1736369  
    136136        add_meta_box( 'wafs_conditions', __( 'Advanced Free Shipping conditions', 'woocommerce-advanced-free-shipping' ), array( $this, 'render_wafs_conditions' ), 'wafs', 'normal' ); 
    137137        add_meta_box( 'wafs_settings', __( 'Shipping settings', 'woocommerce-advanced-free-shipping' ), array( $this, 'render_wafs_settings' ), 'wafs', 'normal' ); 
     138        add_meta_box( 'wafs_resources', __( 'Useful links', 'woocommerce-advanced-free-shipping' ), array( $this, 'render_wafs_resources' ), 'wafs', 'side' ); 
    138139 
    139140    } 
     
    161162    public function render_wafs_settings() { 
    162163        require_once plugin_dir_path( __FILE__ ) . 'admin/views/meta-box-settings.php'; 
     164    } 
     165 
     166 
     167    /** 
     168     * Show resources MB contents. 
     169     * 
     170     * @since 1.1.3 
     171     */ 
     172    function render_wafs_resources() { 
     173 
     174        ?><ul> 
     175            <li><a href="http://jeroensormani.com/how-the-advanced-plugin-conditions-work?utm_source=WAFS-plugin&utm_medium=website&utm_campaign=WAFS-helpful-links" target="_blank"><?php _e( 'How the conditions work', 'woocommerce-advanced-free-shipping' ); ?></a></li> 
     176            <li><a href="http://jeroensormani.com/apply-free-shipping-for-specific-products-in-woocommerce?utm_source=WAFS-plugin&utm_medium=website&utm_campaign=WAFS-helpful-links" target="_blank"><?php _e( 'Applying free shipping to specific products', 'woocommerce-advanced-free-shipping' ); ?></a></li> 
     177            <li><a href="http://jeroensormani.com/showing-add-10-free-shipping-notice#showing-a-free-shipping-notice-for-advanced-shipping?utm_source=WAFS-plugin&utm_medium=website&utm_campaign=WAFS-helpful-links" target="_blank"><?php _e( 'Showing a free shipping message', 'woocommerce-advanced-free-shipping' ); ?></a></li> 
     178            <li><a href="http://jeroensormani.com/shipping-debug-mode?utm_source=WAFS-plugin&utm_medium=website&utm_campaign=WAFS-helpful-links" target="_blank"><?php _e( 'Disabling the shipping cache', 'woocommerce-advanced-free-shipping' ); ?></a></li> 
     179            <li><a href="http://codecanyon.net/item/woocommerce-advanced-shipping/8634573" target="_blank"><?php _e( 'Apply shipping cost using conditions', 'woocommerce-advanced-free-shipping' ); ?></a></li> 
     180            <hr /> 
     181            <li><a href="http://jeroensormani.com/contact?utm_source=WAFS-plugin&utm_medium=website&utm_campaign=WAFS-helpful-links" target="_blank"><?php _e( 'Hire me for custom condition development', 'woocommerce-advanced-free-shipping' ); ?></a></li> 
     182        </ul><?php 
     183 
    163184    } 
    164185 
  • woocommerce-advanced-free-shipping/trunk/libraries/wp-conditions/conditions/wpc-shipping-method-condition.php

    r1609491 r1736369  
    5959 
    6060            $shipping_options = array(); 
    61             foreach ( WC()->shipping->load_shipping_methods() as $method ) : 
    62                 $shipping_options['Methods'][ $method->id ] = $method->get_title(); 
     61            foreach ( WC()->shipping()->load_shipping_methods() as $method ) : 
     62                $shipping_options['Methods'][ $method->id ] = $method->get_method_title(); 
    6363            endforeach; 
    6464 
  • woocommerce-advanced-free-shipping/trunk/libraries/wp-conditions/conditions/wpc-subtotal-ex-tax-condition.php

    r1609491 r1736369  
    2020 
    2121        public function get_compare_value() { 
     22            if ( method_exists( WC()->cart, 'get_subtotal' ) ) { // WC 3.2+ 
     23                return WC()->cart->get_subtotal(); 
     24            } 
     25 
    2226            return WC()->cart->subtotal_ex_tax; 
    2327        } 
  • woocommerce-advanced-free-shipping/trunk/libraries/wp-conditions/conditions/wpc-tax-condition.php

    r1609491 r1736369  
    2020 
    2121        public function get_compare_value() { 
     22            if ( method_exists( WC()->cart, 'get_cart_contents_tax' ) ) { // WC 3.2+ 
     23                return WC()->cart->get_cart_contents_tax(); 
     24            } 
     25 
    2226            return array_sum( (array) WC()->cart->taxes ); 
    2327        } 
  • woocommerce-advanced-free-shipping/trunk/libraries/wp-conditions/readme.txt

    r1687709 r1736369  
    55 
    66 
    7 # Current version: 1.0.3 
     7# Current version: 1.0.5 
    88 
    99# Changelog 
     10 
     11= 1.0.5 - 26/09/2017 = 
     12 
     13- [Improvement] - WC 3.2 changes to prevent notices 
     14 
     15= 1.0.4 - 01/09/2017 = 
     16 
     17- [Improvement] - Use WC_Method:get_method_title() instead of get_title() to get method title. 
    1018 
    1119= 1.0.3 - 28/06/2017 = 
  • woocommerce-advanced-free-shipping/trunk/readme.txt

    r1687709 r1736369  
    44Requires at least: 4.0 
    55Tested up to: 4.8 
    6 Stable tag: 1.1.2 
     6Stable tag: 1.1.3 
     7Requires PHP: 5.3 
    78License: GPLv3 or later 
    89License URI: http://www.gnu.org/licenses/gpl-3.0.html 
     
    101102== Changelog == 
    102103 
     104= 1.1.3 - 26-09-2017 = 
     105 
     106* [Add] - Helpful resources meta box 
     107* [Tested] - WooCommerce 3.2 
     108* [Improvement] - Update WP Conditions to 1.0.5 
     109        - [Improvement] - WC 3.2 changes to prevent notices 
     110        = 1.0.4 = 
     111        - [Improvement] - Use WC_Method:get_method_title() instead of get_title() to get method title. 
     112 
     113 
    103114= 1.1.2 - 29-06-2017 = 
    104115 
  • woocommerce-advanced-free-shipping/trunk/woocommerce-advanced-free-shipping.php

    r1687709 r1736369  
    44 * Plugin URI:      https://wordpress.org/plugins/woocommerce-advanced-free-shipping/ 
    55 * Description:     WooCommerce Advanced Free Shipping is an plugin which allows you to set up advanced free shipping conditions. 
    6  * Version:         1.1.2 
     6 * Version:         1.1.3 
    77 * Author:          Jeroen Sormani 
    88 * Author URI:      http://jeroensormani.com/ 
    99 * Text Domain:     woocommerce-advanced-free-shipping 
     10 * WC requires at least: 3.0.0 
     11 * WC tested up to:      3.2.0 
    1012 
    1113 * Copyright Jeroen Sormani 
     
    4951     * @var string $version Plugin version number. 
    5052     */ 
    51     public $version = '1.1.2'; 
     53    public $version = '1.1.3'; 
    5254 
    5355 
     
    7880    public function __construct() { 
    7981 
    80         if ( ! function_exists( 'is_plugin_active_for_network' ) ) { 
    81             require_once( ABSPATH . '/wp-admin/includes/plugin.php' ); 
     82        // Check if WooCommerce is active 
     83        require_once( ABSPATH . '/wp-admin/includes/plugin.php' ); 
     84        if ( ! is_plugin_active( 'woocommerce/woocommerce.php' ) && ! function_exists( 'WC' ) ) { 
     85            return; 
    8286        } 
    8387 
    84         // Check if WooCommerce is active 
    85         if ( ! in_array( 'woocommerce/woocommerce.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) ) ) : 
    86             if ( ! is_plugin_active_for_network( 'woocommerce/woocommerce.php' ) ) : 
    87                 return; 
    88             endif; 
    89         endif; 
     88        $this->init(); 
    9089 
    9190    } 
     
    164163            require_once plugin_dir_path( __FILE__ ) . 'includes/admin/class-wafs-admin.php'; 
    165164            $this->admin = new WAFS_Admin(); 
    166             $this->admin->init(); 
    167165        endif; 
    168166 
     
    282280 
    283281        ?><div class='updated'> 
    284         <p><?php echo sprintf( __( 'Advanced Free Shipping requires PHP 5.3 or higher and your current PHP version is %s. Please (contact your host to) update your PHP version.', 'woocommerce-advanced-messages' ), PHP_VERSION ); ?></p> 
     282            <p><?php echo sprintf( __( 'Advanced Free Shipping requires PHP 5.3 or higher and your current PHP version is %s. Please (contact your host to) update your PHP version.', 'woocommerce-advanced-messages' ), PHP_VERSION ); ?></p> 
    285283        </div><?php 
    286284 
     
    290288 
    291289 
    292 /** 
    293  * The main function responsible for returning the WooCommerce_Advanced_Free_Shipping object. 
    294  * 
    295  * Use this function like you would a global variable, except without needing to declare the global. 
    296  * 
    297  * Example: <?php WAFS()->method_name(); ?> 
    298  * 
    299  * @since 1.1.0 
    300  * 
    301  * @return  object  WooCommerce_Advanced_Free_Shipping class object. 
    302  */ 
    303290if ( ! function_exists( 'WAFS' ) ) : 
    304291 
     292    /** 
     293     * The main function responsible for returning the WooCommerce_Advanced_Free_Shipping object. 
     294     * 
     295     * Use this function like you would a global variable, except without needing to declare the global. 
     296     * 
     297     * Example: <?php WAFS()->method_name(); ?> 
     298     * 
     299     * @since 1.1.0 
     300     * 
     301     * @return  object  WooCommerce_Advanced_Free_Shipping class object. 
     302     */ 
    305303    function WAFS() { 
    306304 
     
    312310endif; 
    313311 
    314 WAFS()->init(); 
     312WAFS(); 
Note: See TracChangeset for help on using the changeset viewer.