_wpsc_add_customer_meta_to_response

Common routine to put the current customer meta values into an jax response in a format to be consumed by the wp-e-commerce.js ajax processings.

Description

_wpsc_add_customer_meta_to_response( (array) $response, (constant) $meta_keys = null, (string) $meta_key = 'customer_meta' ); 

Parameters (3)

0. $response (array)
Values being readied to send back to javascript in the json encoded AJAX response
1. $meta_keys — Optional. (constant) => null
Meta keys to retrieve, if not specified all meta keys are retrieved
2. $meta_key — Optional. (string) => 'customer_meta'
The meta key.

Usage

  1. if ( !function_exists( '_wpsc_add_customer_meta_to_response' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'wp-ecommerce/wpsc-includes/customer-ajax.php'; 
  3.  
  4. // values being readied to send back to javascript in the json encoded AJAX response 
  5. $response = array(); 
  6.  
  7. // meta keys to retrieve, if not specified all meta keys are retrieved 
  8. $meta_keys = null; 
  9.  
  10. // The meta key. 
  11. $meta_key = 'customer_meta'; 
  12.  
  13. // NOTICE! Understand what this does before running. 
  14. $result = _wpsc_add_customer_meta_to_response($response, $meta_keys, $meta_key); 
  15.  

Defined (1)

The function is defined in the following location(s).

/wpsc-includes/customer-ajax.php