wcpgsk_payments_form

The Woocommerce Poor Guys Swiss Knife wcpgsk payments form function.

Description

wcpgsk_payments_form(); 

Usage

  1. if ( !function_exists( 'wcpgsk_payments_form' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'woocommerce-poor-guys-swiss-knife/wcpgsk-af.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = wcpgsk_payments_form(); 
  7.  

Defined (1)

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

/wcpgsk-af.php  
  1. function wcpgsk_payments_form()  
  2. global $post;//, $woo; 
  3. $postPayments = get_metadata('post', $post->ID, 'payment_gateways', false) ; 
  4. $woogate = new WC_Payment_Gateways(); 
  5.  
  6. $payments = $woogate->payment_gateways();//get_available_payment_gateways(); 
  7.  
  8. foreach ($payments as $pay) { 
  9. $checked = ''; 
  10.  
  11. if ( in_array($pay->id, $postPayments) ) $checked = ' checked="yes" '; 
  12. ?>  
  13. <input type="checkbox" <?php echo $checked; ?> value="<?php echo $pay->id; ?>" name="pays[]" id="payments" /> 
  14. <label for="payment_gateway_meta_box_text"><?php echo $pay->title; ?></label>  
  15. <br />  
  16. <?php  
  17. }  
  18.  
  19. }