Disable all wpsc javascript and css files

Home PageForumsThemes and DesignDisable all wpsc javascript and css files

Tagged: , , ,

This topic has 5 voices, contains 7 replies, and was last updated by  lorax 371 days ago.

Viewing 8 posts - 1 through 8 (of 8 total)
Author Posts
Author Posts
April 24, 2011 at 10:13 am #201476

passatgt

Hi!

I need a really simple shop and i want to create a custom theme. How can i remove all of the wpsc js and css files from the <head> tag?

I found this, but this is only remove the thickbox of course.

add_action( 'init', 'my_deregister_stuff', 100 );

    function my_deregister_stuff() {
    	wp_deregister_style( 'wpsc-thickbox' );
    	wp_deregister_script( 'wpsc-thickbox' );
    }

I need to get rid of all js and css files. Any idea?

April 24, 2011 at 10:34 am #201477

passatgt

Ok, i found a solution, i just need to add all of these inside de my_deregister_stuff:

wp_deregister_style( 'wpsc-theme-css' );
wp_deregister_style( 'wpsc-theme-css-compatibility' );
wp_deregister_style( 'wpsc-product-rater' );
wp_deregister_style('wp-e-commerce-dynamic');
wp_deregister_style( 'wpsc-thickbox' );
wp_deregister_script( 'wpsc-thickbox' );
wp_deregister_script('jquery-rating');
wp_deregister_script( 'wp-e-commerce' );
wp_deregister_script( 'jQuery' );
wp_deregister_script( 'infieldlabel' );
wp_deregister_script( 'wp-e-commerce-ajax-legacy' );
wp_deregister_script( 'wp-e-commerce-dynamic' );
wp_deregister_script( 'livequery' );
wp_deregister_script( 'wp-e-commerce-legacy' );
wp_deregister_script( 'l10n' );
remove_action('wp_head', 'wpsc_product_list_rss_feed');

April 25, 2011 at 9:05 am #201478

cannobbio

Hey!, cool post.
It’s very annoying to have all those stylesheets to override when you want something simple.
You could also add to the list:
wp_deregister_style( 'wpsc-gold-cart' );

EDIT:
Oops! it doesn’t work.
How do I remove this?:

<link rel='stylesheet' id='wpsc-gold-cart-css' href='xxx/wp-content/plugins/gold_cart_files_plugin/css/gold_cart.css?ver=3.1.1' type='text/css' media='all' />

and this:

<script type='text/javascript' src='xxx/wp-content/plugins/gold_cart_files_plugin/js/gold_cart.js?ver=3.1.1'></script>

April 25, 2011 at 9:38 am #201479

cannobbio
// Remove Styles
function childtheme_deregister_styles() {
	wp_deregister_style( 'wpsc-theme-css' );
	wp_deregister_style( 'wpsc-theme-css-compatibility' );
	wp_deregister_style( 'wpsc-product-rater' );
	wp_deregister_style( 'wp-e-commerce-dynamic');
	wp_deregister_style( 'wpsc-thickbox' );
	wp_deregister_style( 'wpsc-gold-cart' );
}
add_action( 'wp_print_styles', 'childtheme_deregister_styles', 100 );

// Remove Scripts
function childtheme_deregister_scripts() {
	wp_deregister_script( 'wpsc-thickbox' );
	wp_deregister_script( 'jquery-rating' );
	wp_deregister_script( 'wp-e-commerce' );
	wp_deregister_script( 'jQuery' );
	wp_deregister_script( 'infieldlabel' );
	wp_deregister_script( 'wp-e-commerce-ajax-legacy' );
	wp_deregister_script( 'wp-e-commerce-dynamic' );
	wp_deregister_script( 'livequery' );
	wp_deregister_script( 'wp-e-commerce-legacy' );
	wp_deregister_script( 'l10n' );
	wp_deregister_script( 'wpsc-gold-cart' );
}
add_action( 'wp_print_scripts', 'childtheme_deregister_scripts', 100 );

// Remove Product List RSS
remove_action('wp_head', 'wpsc_product_list_rss_feed');
April 26, 2011 at 12:56 pm #201480

Draconis
New Member

Where exactly does this get inserted?

April 26, 2011 at 12:58 pm #201481

Roy Ho
Resident Expert
Trusted

In your functions.php file of your active WP theme.

April 26, 2011 at 1:16 pm #201482

Draconis
New Member

cool, thanks Roy, that helps a great deal finding a conflict.

May 13, 2011 at 4:48 am #201483

lorax

I still had some code left over for Gold Cart which I was able to remove using:

remove_action('wp_head', 'gold_shpcrt_javascript', 20);

Viewing 8 posts - 1 through 8 (of 8 total)

You must be logged in to reply to this topic.