woocommerce_external_add_to_cart

Output the external product add to cart area.

Description

woocommerce_external_add_to_cart(); 

Usage

  1. if ( !function_exists( 'woocommerce_external_add_to_cart' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'woocommerce/includes/wc-template-functions.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = woocommerce_external_add_to_cart(); 
  7.  

Defined (1)

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

/includes/wc-template-functions.php  
  1. function woocommerce_external_add_to_cart() { 
  2. global $product; 
  3.  
  4. if ( ! $product->add_to_cart_url() ) { 
  5. return; 
  6.  
  7. wc_get_template( 'single-product/add-to-cart/external.php', array( 
  8. 'product_url' => $product->add_to_cart_url(),  
  9. 'button_text' => $product->single_add_to_cart_text(),  
  10. ) );