wooccm_custom_user_charge_man

The WooCommerce Checkout Manager wooccm custom user charge man function.

Description

wooccm_custom_user_charge_man( $cart ); 

Parameters (1)

0. $cart
The cart.

Usage

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

Defined (1)

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

/includes/classes/main.php  
  1. function wooccm_custom_user_charge_man( $cart ) { 
  2. global $woocommerce, $wpdb; 
  3. $options = get_option( 'wccs_settings' ); 
  4. $options2 = get_option( 'wccs_settings2' ); 
  5. $options3 = get_option( 'wccs_settings3' ); 
  6.  
  7. $saved = WC()->session->get('wooccm_retain', array() ); 
  8.  
  9.  
  10. if ( !empty($options['buttons']) ) { 
  11. foreach ( $options['buttons'] as $btn ) { 
  12.  
  13. if ( !empty( $btn['add_amount'] ) && !empty( $btn['add_amount_field'] ) && !empty( $btn['label'] ) && !empty( $btn['fee_name'] ) ) { 
  14. if ( $saved['wooccm_addamount453user'] == $btn['chosen_valt'] ) {  
  15. $woocommerce->cart->add_fee( $btn['fee_name'], $btn['add_amount_field'], false, '' );  
  16.  
  17. if ( !empty( $btn['add_amount'] ) && empty( $btn['add_amount_field'] ) && !empty( $btn['label'] ) && !empty( $btn['fee_name'] ) ) {  
  18. if ( !empty($saved['wooccm_addamount453userf']) && is_numeric($saved['wooccm_addamount453userf']) ) { 
  19. $woocommerce->cart->add_fee( $btn['fee_name'], $saved['wooccm_addamount453userf'], false, '' );  
  20. }  
  21.  
  22.  
  23.  
  24. if ( !empty($options3['billing_buttons']) ) { 
  25. foreach ( $options3['billing_buttons'] as $btn ) { 
  26.  
  27. if ( !empty( $btn['add_amount'] ) && !empty( $btn['add_amount_field'] ) && !empty( $btn['label'] ) && !empty( $btn['fee_name'] ) ) { 
  28. if ( $saved['wooccm_addamount453user'] == $btn['chosen_valt'] ) {  
  29. $woocommerce->cart->add_fee( $btn['fee_name'], $btn['add_amount_field'], false, '' );  
  30.  
  31. if ( !empty( $btn['add_amount'] ) && empty( $btn['add_amount_field'] ) && !empty( $btn['label'] ) && !empty( $btn['fee_name'] ) ) {  
  32. if ( !empty($saved['wooccm_addamount453userf']) && is_numeric($saved['wooccm_addamount453userf']) ) { 
  33. $woocommerce->cart->add_fee( $btn['fee_name'], $saved['wooccm_addamount453userf'], false, '' );  
  34. }  
  35.  
  36.  
  37.  
  38. if ( !empty($options2['shipping_buttons']) ) { 
  39. foreach ( $options2['shipping_buttons'] as $btn ) { 
  40.  
  41. if ( !empty( $btn['add_amount'] ) && !empty( $btn['add_amount_field'] ) && !empty( $btn['label'] ) && !empty( $btn['fee_name'] ) ) { 
  42. if ( $saved['wooccm_addamount453user'] == $btn['chosen_valt'] ) {  
  43. $woocommerce->cart->add_fee( $btn['fee_name'], $btn['add_amount_field'], false, '' );  
  44.  
  45. if ( !empty( $btn['add_amount'] ) && empty( $btn['add_amount_field'] ) && !empty( $btn['label'] ) && !empty( $btn['fee_name'] ) ) {  
  46. if ( !empty($saved['wooccm_addamount453userf']) && is_numeric($saved['wooccm_addamount453userf']) ) { 
  47. $woocommerce->cart->add_fee( $btn['fee_name'], $saved['wooccm_addamount453userf'], false, '' );  
  48. }  
  49.  
  50.