' ) ) { $ascend = ascend_get_options(); if ( isset( $ascend['product_gallery_zoom'] ) && 1 == $ascend['product_gallery_zoom'] ) { add_theme_support( 'wc-product-gallery-zoom' ); } if ( isset( $ascend['product_gallery_slider'] ) && 1 == $ascend['product_gallery_slider'] ) { add_theme_support( 'wc-product-gallery-slider' ); } } add_filter( 'woocommerce_enqueue_styles', '__return_false' ); // Disable WooCommerce Lightbox if theme lightbox enabled. if ( get_option( 'woocommerce_enable_lightbox' ) == true ) { $ascend = ascend_get_options(); if ( isset( $ascend['kadence_themes_lightbox'] ) && 0 == $ascend['kadence_themes_lightbox'] ) { update_option( 'woocommerce_enable_lightbox', false ); } } /** * Add Woocommerce Notices. */ function ascend_wc_print_notices() { if ( ! is_shop() && ! is_woocommerce() && ! is_cart() && ! is_checkout() && ! is_account_page() ) { echo '
'; echo do_shortcode( '[woocommerce_messages]' ); echo '
'; } } add_action( 'ascend_archive_title_container', 'ascend_wc_print_notices', 40 ); add_action( 'ascend_page_title_container', 'ascend_wc_print_notices', 40 ); add_action( 'ascend_post_header', 'ascend_wc_print_notices', 40 ); add_action( 'ascend_portfolio_header', 'ascend_wc_print_notices', 40 ); add_action( 'ascend_front_page_title_container', 'ascend_wc_print_notices', 40 ); /** * Add Woocommerce Notices. * * @param array $fragments the cart frag. */ function ascend_get_refreshed_fragments( $fragments ) { // Get mini cart. ob_start(); woocommerce_mini_cart(); $mini_cart = ob_get_clean(); // Fragments and mini cart are returned. $fragments['li.kt-mini-cart-refreash'] = '
  • ' . $mini_cart . '
  • '; return $fragments; } if ( version_compare( WC_VERSION, '3.0', '>' ) ) { add_filter( 'woocommerce_add_to_cart_fragments', 'ascend_get_refreshed_fragments' ); } else { add_filter( 'add_to_cart_fragments', 'ascend_get_refreshed_fragments' ); } if ( version_compare( WC_VERSION, '3.0', '>' ) ) { add_filter('woocommerce_add_to_cart_fragments', 'ascend_get_refreshed_fragments_number'); } else { add_filter('add_to_cart_fragments', 'ascend_get_refreshed_fragments_number'); } function ascend_get_refreshed_fragments_number($fragments) { global $woocommerce; // Get mini cart ob_start(); ?>cart->get_cart_contents_count()); ?>