version, '3.0', ">=" ) ) { add_theme_support( 'wc-product-gallery-zoom' ); add_theme_support( 'wc-product-gallery-lightbox' ); add_theme_support( 'wc-product-gallery-slider' ); } } add_action( 'after_setup_theme', 'blossom_studio_woocommerce_support'); /** * Woocommerce Sidebar */ function blossom_studio_wc_widgets_init(){ register_sidebar( array( 'name' => esc_html__( 'Shop Sidebar', 'blossom-studio' ), 'id' => 'shop-sidebar', 'description' => esc_html__( 'Sidebar displaying only in woocommerce pages.', 'blossom-studio' ), 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

', ) ); } add_action( 'widgets_init', 'blossom_studio_wc_widgets_init' ); /** * Before Content * Wraps all WooCommerce content in wrappers which match the theme markup */ function blossom_studio_wc_wrapper(){ ?>
'; dynamic_sidebar( 'shop-sidebar' ); echo ''; } } add_action( 'blossom_studio_wo_sidebar', 'blossom_studio_wc_sidebar_cb' ); /** * Removes the "shop" title on the main shop page */ add_filter( 'woocommerce_show_page_title' , '__return_false' ); if( ! function_exists( 'blossom_studio_wc_cart_count' ) ) : /** * Woocommerce Cart Count * * @link https://isabelcastillo.com/woocommerce-cart-icon-count-theme-header */ function blossom_studio_wc_cart_count(){ $cart_page = get_option( 'woocommerce_cart_page_id' ); $count = WC()->cart->cart_contents_count; if( $cart_page ){ ?>
cart->cart_contents_count; ?> cart->add_to_cart( $product_id, 1 ); $count = WC()->cart->cart_contents_count; $cart_url = $woocommerce->cart->get_cart_url(); ?>