wpsc_enqueue_user_script_and_css

Located in: theme.functions.php

Functions that call this hook: wpsc_enqueue_user_script_and_css()
Arguments Accepted: none

Version Introduced: 3.8

Description:The action wpsc_enqueue_user_script_and_css is triggered within the HEAD of the HTML document and is used to add additional stylesheets (CSS) and scripts (JS) to front end pages.

This hook provides no parameters. You use this hook by having your function echo output to the browser, or by having it perform background tasks. Your functions shouldn’t return, and shouldn’t take any parameters.

Use Case:
[php]<?php
add_action(‘wpsc_enqueue_user_script_and_css’, ‘your_function’);

function your_function() {
$content = ‘<p>This is inserted in the HEAD section of the Products Page.</p>’;
echo $content;
}
?>
[/php]

Code in context:
[php firstline=”541″ highlight=”551″]
/**
* wpsc_user_enqueues products function,
* enqueue all javascript and CSS for wp ecommerce
*/
function wpsc_enqueue_user_script_and_css() {
global $wp_styles, $wpsc_theme_url, $wp_query;
/**
* added by xiligroup.dev to be compatible with touchshop
*/
if ( has_filter( ‘wpsc_enqueue_user_script_and_css’ ) && apply_filters( ‘wpsc_mobile_scripts_css_filters’, false ) ) {
do_action( ‘wpsc_enqueue_user_script_and_css’ );
} else {
/**
* end of added by xiligroup.dev to be compatible with touchshop
*/
$version_identifier = WPSC_VERSION . "." . WPSC_MINOR_VERSION;
$category_id = ”;
if (isset( $wp_query ) && isset( $wp_query->query_vars[‘taxonomy’] ) && (‘wpsc_product_category’ == $wp_query->query_vars[‘taxonomy’] ) || is_numeric( get_option( ‘wpsc_default_category’ ) )
) {
if ( isset($wp_query->query_vars[‘term’]) && is_string( $wp_query->query_vars[‘term’] ) ) {
$category_id = wpsc_get_category_id($wp_query->query_vars[‘term’], ‘slug’);
} else {
$category_id = get_option( ‘wpsc_default_category’ );
}
}

$siteurl = get_option( ‘siteurl’ );

[/php]