WordPress.org

Plugin Directory

Changeset 610733


Ignore:
Timestamp:
10/11/12 09:11:25 (19 months ago)
Author:
garyc40
Message:

Fix: Restore 'wpsc_checkout_user_profile_get' filter and get rid of 'wpshpcrt_usr_profile' user meta.

Location:
wp-e-commerce/branches/branch-3.8
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • wp-e-commerce/branches/branch-3.8/wpsc-includes/checkout.class.php

    r610732 r610733  
    589589        $GLOBALS['wpsc_gateway_error_messages'     ] = wpsc_get_customer_meta( 'gateway_error_messages'      ); 
    590590        $GLOBALS['wpsc_registration_error_messages'] = wpsc_get_customer_meta( 'registration_error_messages' ); 
    591         $GLOBALS['wpsc_customer_checkout_details'  ] = apply_filters( 'wpsc_customer_checkout_details', wpsc_get_customer_meta( 'checkout_details' ) ); 
     591        $GLOBALS['wpsc_customer_checkout_details'  ] = apply_filters( 'wpsc_get_customer_checkout_details', wpsc_get_customer_meta( 'checkout_details' ) ); 
     592 
     593        // legacy filter 
     594        if ( is_user_logged_in() ) 
     595            $GLOBALS['wpsc_customer_checkout_details'] = apply_filters( 'wpsc_checkout_user_profile_get', $GLOBALS['wpsc_customer_checkout_details'], get_current_user_id() ); 
    592596 
    593597        if ( ! is_array( $GLOBALS['wpsc_customer_checkout_details'] ) ) 
     
    929933        wpsc_update_customer_meta( 'checkout_error_messages'     , $wpsc_checkout_error_messages     ); 
    930934        wpsc_update_customer_meta( 'gateway_error_messages'      , $wpsc_gateway_error_messages      ); 
    931         wpsc_update_customer_meta( 'checkout_details'            , $wpsc_customer_checkout_details   ); 
    932935        wpsc_update_customer_meta( 'registration_error_messages' , $wpsc_registration_error_messages ); 
     936 
     937        if ( ! $any_bad_inputs ) { 
     938            $filtered_checkout_details = apply_filters( 'wpsc_update_customer_checkout_details', $wpsc_customer_checkout_details ); 
     939            // legacy filter 
     940            if ( is_user_logged_in() ) 
     941                $filtered_checkout_details = apply_filters( 'wpsc_checkout_user_profile_update', $wpsc_customer_checkout_details, get_current_user_id() ); 
     942            wpsc_update_customer_meta( 'checkout_details', $filtered_checkout_details ); 
     943        } 
    933944 
    934945        if ( $location_changed ) 
    935946            $wpsc_cart->update_location(); 
    936  
    937         if ( ( $any_bad_inputs == false ) && ( $user_ID > 0 ) ) { 
    938             $meta_data = $_POST['collected_data']; 
    939             $meta_data = apply_filters( 'wpsc_checkout_user_profile_update', $meta_data, $user_ID ); 
    940             update_user_meta( $user_ID, 'wpshpcrt_usr_profile', $meta_data ); 
    941         } 
    942947 
    943948        $states = array( 'is_valid' => !$any_bad_inputs, 'error_messages' => $bad_input_message ); 
  • wp-e-commerce/branches/branch-3.8/wpsc-theme/functions/wpsc-user_log_functions.php

    r586517 r610733  
    109109        } 
    110110        $meta_data = apply_filters( 'wpsc_user_log_update', $meta_data, $user_ID ); 
    111         update_user_meta( $user_ID, 'wpshpcrt_usr_profile', $meta_data ); 
     111        wpsc_update_customer_meta( 'checkout_details', $meta_data ); 
    112112    } 
    113113    if ( $changes_saved ) { 
     
    139139        $wpsc_checkout = new WPSC_Checkout(); 
    140140 
    141     $meta_data = null; 
    142     $saved_data_sql = "SELECT * FROM `" . $wpdb->usermeta . "` WHERE `user_id` = '" . $user_ID . "' AND `meta_key` = 'wpshpcrt_usr_profile';"; 
    143     $saved_data = $wpdb->get_row( $saved_data_sql, ARRAY_A ); 
    144  
    145     $meta_data = get_user_meta( $user_ID, 'wpshpcrt_usr_profile', 1 ); 
     141    $meta_data = wpsc_get_customer_meta( 'checkout_details' ); 
    146142    $meta_data = apply_filters( 'wpsc_user_log_get', $meta_data, $user_ID ); 
    147143 
Note: See TracChangeset for help on using the changeset viewer.