A simple, powerful and independent e-commerce platform.
Sell anything with ease.

Disable default Classic Commerce stylesheets

Classic Commerce enqueues 3 stylesheets by default. You can disable them all, or selectively remove some, with the following snippets. This is the recommended process if you’re building a custom theme. Removing the default Classic Commerce stylesheet and enqueuing your own will protect you during Classic Commerce core updates.

		/**
 * Disable default Classic Commerce style sheets
 */

// Disables all three default stylesheets, or selectively disables some
// https://docs.woocommerce.com/document/disable-the-default-stylesheet/

// Disable all
add_filter('woocommerce_enqueue_styles', '__return_empty_array');

// Choose which stylesheets to disable
add_filter('woocommerce_enqueue_styles', 'jk_dequeue_styles');

function jk_dequeue_styles($enqueue_styles) {
  unset($enqueue_styles['woocommerce-general']);  // Remove the gloss
  unset($enqueue_styles['woocommerce-layout']);  // Remove the layout
  unset($enqueue_styles['woocommerce-smallscreen']);  // Remove the smallscreen optimisation
  return $enqueue_styles;
}

// Then enqueue your own stylesheet
add_action('wp_enqueue_scripts', 'cc_enqueue_my_style');

function cc_enqueue_my_style(){
  wp_register_style('mytheme-woocommerce', get_template_directory_uri() . '/css/woocommerce.css');

  if ( class_exists('woocommerce')) {
    wp_enqueue_style('mytheme-woocommerce');
  }
}
	
View Raw Code ID: 91390