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. $discover = get_option( 'wc_apm_discover' ); 
  8. $bitcoin = get_option( 'wc_apm_bitcoin' ); 
  9. $maestro = get_option( 'wc_apm_maestro' ); 
  10. $cod = get_option( 'wc_apm_cash_on_delivery'); 
  11. $dankort = get_option( 'wc_apm_dankort'); 
  12.  
  13. // Display 
  14. echo '<ul class="accepted-payment-methods">'; 
  15. if ( $dankort == "yes" ) { echo '<li class="dankort"><span>Dankort</span></li>'; } 
  16. if ( $amex == "yes" ) { echo '<li class="american-express"><span>American Express</span></li>'; } 
  17. if ( $bitcoin == "yes" ) { echo '<li class="bitcoin"><span>Bitcoin</span></li>'; } 
  18. if ( $cod == "yes" ) { echo '<li class="cash-on-delivery"><span>Cash on Delivery</span></li>'; } 
  19. if ( $discover == "yes" ) { echo '<li class="discover"><span>Discover</span></li>'; } 
  20. if ( $google == "yes" ) { echo '<li class="google"><span>Google</span></li>'; } 
  21. if ( $maestro == "yes" ) { echo '<li class="maestro"><span>Maestro</span></li>'; } 
  22. if ( $mastercard == "yes" ) { echo '<li class="mastercard"><span>MasterCard</span></li>'; } 
  23. if ( $paypal == "yes" ) { echo '<li class="paypal"><span>PayPal</span></li>'; } 
  24. if ( $visa == "yes" ) { echo '<li class="visa"><span>Visa</span></li>'; } 
  25. echo '</ul>';