Plugin Directory

Changeset 1485122


Ignore:
Timestamp:
08/28/2016 03:35:20 PM (10 years ago)
Author:
opentools
Message:

V1.2.5: New variables userroles, userid, username, first_name, last_name, email

Location:
shipping-by-rules-for-woocommerce
Files:
4 edited
13 copied

Legend:

Unmodified
Added
Removed
  • shipping-by-rules-for-woocommerce/tags/1.2.5/includes/rules_shipping_framework_woocommerce.php

    r1470312 r1485122  
    307307        /* Get the user from the package information and extract further information about the buyer */
    308308        $user = $cart['user'];
    309         // TODO: Extract user!
    310 /**     $data['company'] = isset($address['company'])?$address['company']:'';
     309        $data['userid'] = $user['ID'];
     310        $data['userroles'] = array();
     311        $data['username'] = '';
     312        $data['first_name'] = '';
     313        $data['last_name'] = '';
     314        $data['email'] = '';
     315        if ($user['ID']>0) {
     316            $userinfo = get_userdata($user['ID']);
     317            $data['userroles'] = $userinfo->roles;
     318            $data['username'] = $userinfo->user_login;
     319           
     320            $data['first_name'] = $userinfo->first_name;
     321            $data['last_name'] = $userinfo->last_name;
     322       
     323            $data['email'] = isset($address['email'])?$address['email']:'';
     324        // TODO: Extract more user fields!
     325/**     
     326        $data['company'] = isset($address['company'])?$address['company']:'';
    311327        $data['title'] = isset($address['title'])?$address['title']:'';
    312         $data['first_name'] = isset($address['title'])?$address['title']:'';
    313328        $data['middle_name'] = isset($address['middle_name'])?$address['middle_name']:'';
    314         $data['last_name'] = isset($address['last_name'])?$address['last_name']:'';
    315329        $data['phone1'] = isset($address['phone_1'])?$address['phone_1']:'';
    316330        $data['phone2'] = isset($address['phone_2'])?$address['phone_2']:'';
    317331        $data['fax'] = isset($address['fax'])?$address['fax']:'';
    318         $data['email'] = isset($address['email'])?$address['email']:'';
    319332*/
     333        }
    320334        // The country check needs the countryid variable, so duplicate from country:
    321335        $data['countryid'] = $data['country'];
     336
    322337        return $data;
    323338    }
  • shipping-by-rules-for-woocommerce/tags/1.2.5/library/rules_shipping_framework.php

    r1453033 r1485122  
    917917        } elseif ($varname=='values') {
    918918            return $vals;
    919         } elseif ($varname=='values_debug' || $varname='debug_values') {
     919        } elseif ($varname=='values_debug' || $varname=='debug_values') {
    920920            $tmpvals = $vals;
    921921            unset($tmpvals['debug_cart']);
  • shipping-by-rules-for-woocommerce/tags/1.2.5/readme.txt

    r1470312 r1485122  
    44Requires at least: 4.0
    55Tested up to: 4.5
    6 Stable tag: 1.2.4
     6Stable tag: 1.2.5
    77License: GPLv3 or later
    88License URI: http://www.gnu.org/licenses/gpl.html
     
    7070== Changelog ==
    7171
     72= 1.2.5 =
     73* Add variables username, first_name, last_name, email
     74* Add list variable userroles (advanced version only)
     75* Fix issue with debug_variables
     76
    7277= 1.2.4 =
    7378* Fix incompatibility with Cash on Delivery (returned id should be prefixed with the method ID)
  • shipping-by-rules-for-woocommerce/tags/1.2.5/woocommerce-shipping-by-rules.php

    r1470312 r1485122  
    44 * Plugin URI: http://open-tools.net/woocommerce/advanced-shipping-by-rules-for-woocommerce.html
    55 * Description: Define Shipping cost by very general and flexible (text-based) rules.
    6  * Version: 1.2.4
     6 * Version: 1.2.5
    77 * Author: Open Tools, Reinhold Kainhofer
    88 * Author URI: http://open-tools.net
     
    4949     * @var string $version Plugin version number.
    5050     */
    51     public $version = '1.2.4';
     51    public $version = '1.2.5';
    5252
    5353
  • shipping-by-rules-for-woocommerce/trunk/includes/rules_shipping_framework_woocommerce.php

    r1470312 r1485122  
    307307        /* Get the user from the package information and extract further information about the buyer */
    308308        $user = $cart['user'];
    309         // TODO: Extract user!
    310 /**     $data['company'] = isset($address['company'])?$address['company']:'';
     309        $data['userid'] = $user['ID'];
     310        $data['userroles'] = array();
     311        $data['username'] = '';
     312        $data['first_name'] = '';
     313        $data['last_name'] = '';
     314        $data['email'] = '';
     315        if ($user['ID']>0) {
     316            $userinfo = get_userdata($user['ID']);
     317            $data['userroles'] = $userinfo->roles;
     318            $data['username'] = $userinfo->user_login;
     319           
     320            $data['first_name'] = $userinfo->first_name;
     321            $data['last_name'] = $userinfo->last_name;
     322       
     323            $data['email'] = isset($address['email'])?$address['email']:'';
     324        // TODO: Extract more user fields!
     325/**     
     326        $data['company'] = isset($address['company'])?$address['company']:'';
    311327        $data['title'] = isset($address['title'])?$address['title']:'';
    312         $data['first_name'] = isset($address['title'])?$address['title']:'';
    313328        $data['middle_name'] = isset($address['middle_name'])?$address['middle_name']:'';
    314         $data['last_name'] = isset($address['last_name'])?$address['last_name']:'';
    315329        $data['phone1'] = isset($address['phone_1'])?$address['phone_1']:'';
    316330        $data['phone2'] = isset($address['phone_2'])?$address['phone_2']:'';
    317331        $data['fax'] = isset($address['fax'])?$address['fax']:'';
    318         $data['email'] = isset($address['email'])?$address['email']:'';
    319332*/
     333        }
    320334        // The country check needs the countryid variable, so duplicate from country:
    321335        $data['countryid'] = $data['country'];
     336
    322337        return $data;
    323338    }
  • shipping-by-rules-for-woocommerce/trunk/library/rules_shipping_framework.php

    r1453033 r1485122  
    917917        } elseif ($varname=='values') {
    918918            return $vals;
    919         } elseif ($varname=='values_debug' || $varname='debug_values') {
     919        } elseif ($varname=='values_debug' || $varname=='debug_values') {
    920920            $tmpvals = $vals;
    921921            unset($tmpvals['debug_cart']);
  • shipping-by-rules-for-woocommerce/trunk/readme.txt

    r1470312 r1485122  
    44Requires at least: 4.0
    55Tested up to: 4.5
    6 Stable tag: 1.2.4
     6Stable tag: 1.2.5
    77License: GPLv3 or later
    88License URI: http://www.gnu.org/licenses/gpl.html
     
    7070== Changelog ==
    7171
     72= 1.2.5 =
     73* Add variables username, first_name, last_name, email
     74* Add list variable userroles (advanced version only)
     75* Fix issue with debug_variables
     76
    7277= 1.2.4 =
    7378* Fix incompatibility with Cash on Delivery (returned id should be prefixed with the method ID)
  • shipping-by-rules-for-woocommerce/trunk/woocommerce-shipping-by-rules.php

    r1470312 r1485122  
    44 * Plugin URI: http://open-tools.net/woocommerce/advanced-shipping-by-rules-for-woocommerce.html
    55 * Description: Define Shipping cost by very general and flexible (text-based) rules.
    6  * Version: 1.2.4
     6 * Version: 1.2.5
    77 * Author: Open Tools, Reinhold Kainhofer
    88 * Author URI: http://open-tools.net
     
    4949     * @var string $version Plugin version number.
    5050     */
    51     public $version = '1.2.4';
     51    public $version = '1.2.5';
    5252
    5353
Note: See TracChangeset for help on using the changeset viewer.