page_title === 'yes' && themify_is_shop() ) { add_filter( 'woocommerce_show_page_title', '__return_false', 100 ); } if ( is_product() ) { add_filter( 'woocommerce_post_class', array( __CLASS__, 'woocommerce_post_class' ), 10, 2 ); } } /** * Add Product taxonomy as Body Class to Single Product Page * * @access public */ public static function single_product_body_class( $classes ) { $classes[] = 'woocommerce-js'; $index = array_search( 'woocommerce-no-js', $classes, true ); if ( $index !== false ) { unset( $classes[ $index ] ); } if ( is_singular( 'product' ) ) { $current_product = wc_get_product(); $id = $current_product->get_id(); $tax = array( 'product_cat', 'product_tag' ); foreach ( $tax as $v ) { $custom_terms = get_the_terms( $id, $v ); if ( $custom_terms ) { foreach ( $custom_terms as $custom_term ) { $classes[] = $v . '_' . $custom_term->slug; } } } } return $classes; } public static function woocommerce_post_class( $classes, $product ) { if ( $product->get_id() === get_queried_object_id() ) { $classes[] = 'tf_clearfix'; } return $classes; } } if ( ! function_exists( 'themify_wc_accordion_tabs' ) ) : function themify_wc_accordion_tabs( $located, $template_name, $args, $template_path, $default_path ) { if ( 'single-product/tabs/tabs.php' == $template_name ) { remove_filter( 'wc_get_template', 'themify_wc_accordion_tabs', 10 ); return THEMIFY_DIR . '/includes/wc-accordion-tabs.php'; } return $located; } endif; if ( ! function_exists( 'themify_wc_sticky_buy' ) ) : function themify_wc_sticky_buy() { if ( is_product() && ! ( class_exists( 'Themify_Builder_Model', false ) && Themify_Builder_Model::is_front_builder_activate() ) && ! themify_check( 'setting-st_add_cart', true ) ) { add_action( 'woocommerce_before_add_to_cart_form', 'themify_sticky_buy_observer_start' ); add_action( 'woocommerce_after_add_to_cart_form', 'themify_sticky_buy_observer_end' ); } } endif; if ( ! function_exists( 'themify_sticky_buy_observer_start' ) ) : function themify_sticky_buy_observer_start() { ob_start(); echo '