wpsc_alternate_cart_html

Located in: ajax.functions.php

Functions that call this hook: wpsc_add_to_cart(), wpsc_get_cart(), wpsc_alternate_cart_html(), wpsc_update_item_quantity()
Arguments Accepted: wpsc_add_to_cart() function calls the hook and accepts one argument $cart_message all other functions accept no arguments.
Version Introduced: 3.8

Description: Hook to change the HTML displayed in the cart widget.

Code in context:
[php firstline=”189″ highlight=”206″]
/**
* empty cart function, used through ajax and in normal page loading.
* No parameters, returns nothing
*/
function wpsc_empty_cart() {
global $wpdb, $wpsc_cart;
$wpsc_cart->empty_cart( false );

if ( $_REQUEST[‘ajax’] == ‘true’ ) {
ob_start();

include_once( wpsc_get_template_file_path( ‘wpsc-cart_widget.php’ ) );
$output = ob_get_contents();

ob_end_clean();
$output = str_replace( Array( "n", "r" ), Array( "n", "r" ), addslashes( $output ) );
echo "jQuery(‘div.shopping-cart-wrapper’).html(‘$output’);";
do_action( ‘wpsc_alternate_cart_html’ );

if ( get_option( ‘show_sliding_cart’ ) == 1 ) {
$_SESSION[‘slider_state’] = 0;
echo "
jQuery(‘#sliding_cart’).slideUp(‘fast’,function(){
jQuery(‘#fancy_collapser’).attr(‘src’, (WPSC_CORE_IMAGES_URL+’/plus.png’));
});
";
}
exit();
}

// this if statement is needed, as this function also runs on returning from the gateway
if ( $_REQUEST[‘wpsc_ajax_action’] == ’empty_cart’ ) {
wp_redirect( remove_query_arg( array( ‘wpsc_ajax_action’, ‘ajax’ ) ) );
exit();
}
}
[/php]