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 '
'; return ob_end_flush(); } endif; if ( ! function_exists( 'themify_sticky_buy_observer_end' ) ) : function themify_sticky_buy_observer_end() { ob_start(); echo '
'; return ob_end_flush(); } endif; if ( ! function_exists( 'themify_before_wrap_content' ) ) : function themify_before_wrap_content() { if ( function_exists( 'themify_before_shop_content' ) && current_action() === 'woocommerce_before_main_content' ) { return; } ?>
='); // Map of renamed script handles (WooCommerce 10.3.0+) $renamed_scripts = [ 'js-cookie' => 'wc-js-cookie', 'jquery-blockui' => 'wc-jquery-blockui', 'flexslider' => 'wc-flexslider', 'photoswipe-ui-default' => 'wc-photoswipe-ui-default', 'zoom' => 'wc-zoom', ]; // Normalize both prefixed and unprefixed handles. foreach ($renamed_scripts as $old => $new) { if ($handle === $old || $handle === $new) { return $is_new ? $new : $old; } } // Return original handle if no match found. return $handle; } endif;