wpsc_add_to_cart_button

19-02-09 add cart button function used for php template tags and shortcodes.

Description

wpsc_add_to_cart_button( $product_id, (bool) $return = false ); 

Parameters (2)

0. $product_id
The product id.
1. $return — Optional. (bool) => false
The return.

Usage

  1. if ( !function_exists( 'wpsc_add_to_cart_button' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'wp-ecommerce/wpsc-components/theme-engine-v1/helpers/ajax.php'; 
  3.  
  4. // The product id. 
  5. $product_id = null; 
  6.  
  7. // The return. 
  8. $return = false; 
  9.  
  10. // NOTICE! Understand what this does before running. 
  11. $result = wpsc_add_to_cart_button($product_id, $return); 
  12.  

Defined (1)

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

/wpsc-components/theme-engine-v1/helpers/ajax.php