wc_accepted_payment_methods

The WooCommerce Accepted Payment Methods wc accepted payment methods function.

Description

wc_accepted_payment_methods(); 

Usage

  1. if ( !function_exists( 'wc_accepted_payment_methods' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'woocommerce-accepted-payment-methods/accepted-payment-methods.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = wc_accepted_payment_methods(); 
  7.  

Defined (1)

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

/accepted-payment-methods.php  
  1. function wc_accepted_payment_methods() { 
  2. $amex = get_option( 'wc_apm_american_express' ); 
  3. $google = get_option( 'wc_apm_google' ); 
  4. $mastercard = get_option( 'wc_apm_mastercard' ); 
  5. $paypal = get_option( 'wc_apm_paypal' ); 
  6. $visa = get_option( 'wc_apm_visa' ); 
  7.  
  8. // Display 
  9. echo '<ul class="accepted-payment-methods">'; 
  10. if ( $amex == "yes" ) { echo '<li class="american-express"><span>American Express</span></li>'; } 
  11. if ( $google == "yes" ) { echo '<li class="google"><span>Google</span></li>'; } 
  12. if ( $mastercard == "yes" ) { echo '<li class="mastercard"><span>MasterCard</span></li>'; } 
  13. if ( $paypal == "yes" ) { echo '<li class="paypal"><span>PayPal</span></li>'; } 
  14. if ( $visa == "yes" ) { echo '<li class="visa"><span>Visa</span></li>'; } 
  15. echo '</ul>';