Plugin Directory

Changeset 987197


Ignore:
Timestamp:
09/11/2014 11:59:20 AM (12 years ago)
Author:
ulih
Message:

Version 1.9.82 Second service update for WooCommerce 2.2

Location:
woocommerce-poor-guys-swiss-knife/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • woocommerce-poor-guys-swiss-knife/trunk/classes/woocommerce-poor-guys-swiss-knife.php

    r986730 r987197  
    107107           
    108108            add_action( 'woocommerce_init', array( $this, 'wcpgsk_empty_cart' ), PHP_INT_MAX );
    109        
     109            add_action( 'woocommerce_checkout_update_order_meta', array( $this, 'wcpgsk_checkout_update_order_meta' ), 10, 2 );
    110110        }
    111111
     
    32963296               
    32973297                elseif ( ( isset($options['woofields']['billing'][$key]['custom_' . $key]) && $options['woofields']['billing'][$key]['custom_' . $key] ) || ( isset( $options['woofields']['shipping'][$key]['custom_' . $key] ) && $options['woofields']['shipping'][$key]['custom_' . $key] ) ) :
    3298                     //validate date fields
    3299                     /*
    3300                     if ( $options['woofields']['type_' . $key] == 'text' && !empty($_POST[$key]) ) :
    3301                         if ( isset( $params['pattern'] ) && !empty( $params['pattern'] ) ) :
    3302                             $pregex = @preg_match('/' . str_replace( "/", "\/", $params['pattern'] ) . '/', $_POST[$key]);
    3303                             if ($pregex === false || $pregex === 0) :
    3304                                 // the regex failed and is likely invalid
    3305                                 $forLabel = $_POST[$key];
    3306                                 if ( isset($options['woofields']['label_' . $key]) && !empty($options['woofields']['label_' . $key]) ) :
    3307                                     $forLabel = __($options['woofields']['label_' . $key], WCPGSK_DOMAIN);
    3308                                 endif;
    3309                                 wcpgsk_add_error(  '<strong>' . sprintf(__('Value of <em style="color:red">%s</em> does not fulfil the established pattern test: <em>%s</em>!', WCPGSK_DOMAIN), $forLabel, $params['pattern'] ) . '</strong>');                                                     
    3310                             else :
    3311                                 wcpgsk_add_error(  '<strong>Pattern matched?</strong>');                                                                                                           
    3312                             endif;
    3313                         else :
    3314                             wcpgsk_add_error(  '<strong>No pattern</strong>');                                                                             
    3315                         endif;
    3316                     endif;
    3317                     */
    33183298                    if ( $options['woofields']['type_' . $key] == 'date' && !empty($_POST[$key]) ) :
    33193299                        //transform back based on field setting
     
    34203400        }
    34213401       
     3402        function wcpgsk_checkout_update_order_meta( $order_id, $posted ) {
     3403            global $woocommerce;
     3404            global $wcpgsk_session;
     3405            if ( function_exists('WC') ) :
     3406                WC()->session->set('post', $_POST);
     3407            else :
     3408                $wcpgsk_session->post = $_POST;
     3409            endif;         
     3410            $options = get_option( 'wcpgsk_settings' );
     3411            foreach($posted as $key => $val) :
     3412                if ( isset($options['woofields']['billing'][$key]['custom_' . $key] ) || isset($options['woofields']['billing'][$key]['custom_' . $key] ) ) :
     3413                    update_post_meta( $order_id, "_" . $key, $val );
     3414                endif;
     3415            endforeach;
     3416       
     3417        }
    34223418       
    34233419        public function createCustomStandardField($customkey, $context, $type) {
  • woocommerce-poor-guys-swiss-knife/trunk/readme.txt

    r986730 r987197  
    55Requires at least: Wordpress 3.1 and WooCommerce 2.0
    66Tested up to: 4.0
    7 Stable tag: 1.9.81
     7Stable tag: 1.9.82
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    261261== Changelog ==
    262262
     263= 1.9.82 =
     264
     265* Service release for WooCommerce 2.2 fixing order meta storage
     266
    263267= 1.9.81 =
    264268
  • woocommerce-poor-guys-swiss-knife/trunk/woocommerce-poor-guys-swiss-knife.php

    r986730 r987197  
    88 * Author: Uli Hake
    99 * Author URI: http://takebarcelona.com/authorship/uli-hake
    10  * Version: 1.9.81
     10 * Version: 1.9.82
    1111 * @package WordPress
    1212 * @subpackage WooCommerce Poor Guys Swiss Knife
     
    107107        //load into our global
    108108        $wcpgsk = new WCPGSK_Main( __FILE__ );
    109         $wcpgsk->version = '1.9.81';   
     109        $wcpgsk->version = '1.9.82';   
    110110        $wcpgsk->wcpgsk_hook_woocommerce_filters();
    111111       
Note: See TracChangeset for help on using the changeset viewer.