Your IP : 216.73.216.95


Current Path : /var/test/www/ya/wp-content/themes/youthy/framework/
Upload File :
Current File : /var/test/www/ya/wp-content/themes/youthy/framework/woocommerce.php

<?php

	// WooCommerce specific
	add_theme_support( 'woocommerce' );



  if ( class_exists( 'WooCommerce' ) ) {





					// Ensure cart contents update when products are added to the cart via AJAX
					add_filter( 'woocommerce_add_to_cart_fragments', 'woocommerce_header_add_to_cart_fragment' );

					function woocommerce_header_add_to_cart_fragment( $fragments ) {
						ob_start();
						?>
						<span class="cart-details"><?php echo sprintf (_n( '%d ', '%d ', WC()->cart->cart_contents_count ), WC()->cart->cart_contents_count ); ?> - <?php echo WC()->cart->get_cart_total(); ?></span>
						<?php

						$fragments['span.cart-details'] = ob_get_clean();

						return $fragments;
					}


          if ( get_theme_mod( 'show_woocommerce_styles' , '1' ) === "1" ) {

						// Remove WooCommerce styles
						add_filter( 'woocommerce_enqueue_styles', '__return_empty_array' );

						// Load theme specific files instead...
						function mt_enqueue_woocommerce_style(){

								wp_register_style( 'mt-woocommerce', get_template_directory_uri() . '/mt-woocommerce.css', array(), MEANTHEMES_THEME_VER, 'screen' );
								wp_enqueue_style( 'mt-woocommerce' );

						}
						add_action( 'wp_enqueue_scripts', 'mt_enqueue_woocommerce_style' );



          }



  }

?>