wcpgsk_cart_button_text

Personalize Add to Cart Button.

Description

wcpgsk_cart_button_text( $label ); 

Parameters (1)

0. $label
The label.

Usage

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

Defined (1)

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

/wcpgsk-af.php  
  1. function wcpgsk_cart_button_text($label) { 
  2. global $post; 
  3.  
  4. $options = get_option( 'wcpgsk_settings' ); 
  5. $cart_btn_text = ((!empty($options['process']['fastcheckoutbtn'])) ? __($options['process']['fastcheckoutbtn'], WCPGSK_DOMAIN) : $label); 
  6. if ( isset( $post->ID ) && ( is_shop() || is_product() ) ) : 
  7. $button_label = get_post_meta($post->ID, '_wcpgsk_button_label', true); 
  8. if ( isset( $button_label ) && !empty( $button_label ) ) : 
  9. $cart_btn_text = "hoopie";//__( $button_label, WCPGSK_DOMAIN ); 
  10. endif; 
  11. endif; 
  12. if ($cart_btn_text && $cart_btn_text != '') 
  13. return $cart_btn_text; 
  14. else return __('Add to Cart', WCPGSK_DOMAIN);