300, ) ); } endif; add_action( 'after_setup_theme', 'asterisk_lite_woocommerce_support' ); if ( ! function_exists( 'asterisk_lite_cart_link_fragment' ) ): /** * Cart Fragments. * * Ensure cart contents update when products are added to the cart via AJAX. * * @param array $fragments Fragments to refresh via AJAX. * @return array Fragments to refresh via AJAX. */ function asterisk_lite_cart_link_fragment( $fragments ) { ob_start(); asterisk_lite_cart_link(); $fragments['.cart-total-item'] = ob_get_clean(); return $fragments; } endif; add_filter( 'woocommerce_add_to_cart_fragments', 'asterisk_lite_cart_link_fragment' ); if ( ! function_exists( 'asterisk_lite_cart_link' ) ): /** * Cart Link. * * Displayed a link to the cart including the number of items present and the cart total. * * @return void */ function asterisk_lite_cart_link() { ?>
cart->get_cart_contents_count() <= 0 ){ ?>style="opacity: 0" class="cart-total-item"> cart->get_cart_contents_count(), 'asterisk-lite' ), WC()->cart->get_cart_contents_count() ); ?> cart->get_cart_subtotal() ); ?> cart->get_cart_contents_count() ); ?>
'', ); the_widget( 'WC_Widget_Cart', $instance ); ?>
version, '3.0.0', '>=' ) ) { if( current_theme_supports('wc-product-gallery-zoom') ) { wp_enqueue_script('zoom'); } if( current_theme_supports('wc-product-gallery-lightbox') ) { wp_enqueue_script('photoswipe-ui-default'); wp_enqueue_style('photoswipe-default-skin'); if( has_action('wp_footer', 'woocommerce_photoswipe') === FALSE ) { add_action('wp_footer', 'woocommerce_photoswipe', 15); } } wp_enqueue_script('wc-single-product'); } } endif; add_action('wp_enqueue_scripts', 'asterisk_lite_scripts_woocommerce_gallery'); if ( ! function_exists( 'asterisk_lite_cart_subtotal_escape' ) ) : /** * Sanitise Cart Subtotal */ function asterisk_lite_cart_subtotal_escape($input){ $all_tags = array( 'span'=>array( 'class'=>array() ) ); return wp_kses($input,$all_tags); } endif;