wccs_custom_checkout_field_pro_update_order_meta

The WooCommerce Checkout Manager wccs custom checkout field pro update order meta function.

Description

wccs_custom_checkout_field_pro_update_order_meta( $order ); 

Parameters (1)

0. $order
The order.

Usage

  1. if ( !function_exists( 'wccs_custom_checkout_field_pro_update_order_meta' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'woocommerce-checkout-manager/includes/classes/main.php'; 
  3.  
  4. // The order. 
  5. $order = null; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = wccs_custom_checkout_field_pro_update_order_meta($order); 
  9.  

Defined (1)

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

/includes/classes/main.php  
  1. function wccs_custom_checkout_field_pro_update_order_meta( $order ) { 
  2. $options = get_option( 'wccs_settings' ); 
  3.  
  4. foreach ( $options['buttons'] as $btn ) : 
  5. $label = ( isset( $btn['label'] ) ) ? $btn['label'] : ''; 
  6.  
  7. if ( $btn['type'] !== 'multiselect' && $btn['type'] !== 'multicheckbox' ) { 
  8. if ( $_POST[ ''.$btn['cow'].'' ]) { 
  9. update_post_meta( $order, ''.$btn['cow'].'' , $_POST[ ''.$btn['cow'].'' ] ); 
  10. } elseif ( $btn['type'] == 'multiselect' || $btn['type'] == 'multicheckbox' ) { 
  11.  
  12. if ( $_POST[ ''.$btn['cow'].'' ]) { 
  13. update_post_meta( $order, ''.$btn['cow'].'' , serialize( $_POST[ ''.$btn['cow'].'' ] )); 
  14.  
  15. endforeach;