Skip to content

Commit

Permalink
Merge branch 'eri-trabiccolo-woocommerce3-compat' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
nikeo committed Apr 6, 2017
2 parents 401e281 + a21c128 commit 5a87171
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions functions/init-plugins-compat.php
Expand Up @@ -16,6 +16,9 @@ function hu_set_plugins_supported() {
add_theme_support( 'uris' );///Ultimate Responsive Image Slider
add_theme_support( 'the-events-calendar' );///Ultimate Responsive Image Slider
add_theme_support( 'woocommerce' );///WooCoomerce
add_theme_support( 'wc-product-gallery-zoom' );
add_theme_support( 'wc-product-gallery-lightbox' );
add_theme_support( 'wc-product-gallery-slider' );
add_theme_support( 'wp-pagenavi' );///WP PageNavi
}

Expand Down Expand Up @@ -201,9 +204,11 @@ function hu_print_woocommerce_page_title( $title ) {
if ( isset($product) ) :
$review_enabled = get_option( 'woocommerce_enable_review_rating' ) !== 'no';
$review_count = $review_enabled ? $product->get_review_count() : '';
$product_id = method_exists( $product, 'get_id' ) ? $product->get_id() : $product->id;
$categories = function_exists( 'wc_get_product_category_list' ) ? wc_get_product_category_list( $product_id, '<span>/</span>' ) : $product->get_categories( '<span>/</span>' );
?>
<ul class="meta-single group">
<li class="category category_products"><?php echo $product->get_categories( '<span>/</span>' ); ?></li>
<li class="category category_products"><?php echo $categories ?></li>
<?php if ( comments_open() && ( hu_is_checked( 'comment-count' ) ) && $review_enabled ): ?>
<li class="comments rewiews"><a href="#reviews" class="woocommerce-review-link" rel="nofollow"><i class="fa fa-star-o"></i><?php echo $review_count ? '<span itemprop="reviewCount" class="count">'.$review_count.'</span>' : '' ?></a></li>
<?php endif /*comments_open*/ ?>
Expand Down Expand Up @@ -247,11 +252,13 @@ function hu_wc_additional_information_tab_title( $title ){
function hu_wc_reviews_tab_title( $title ) {
if ( apply_filters( 'hu_wc_experimental_reviews_tab_title', true ) ) {
global $product;
$review_count = isset( $product ) ? $product->get_review_count() : '';
$review_count_search = !empty($review_count) ? "($review_count)" : '';
$review_count_replace = !empty($review_count) ? "<span>$review_count</span>" : '';
if ( isset( $product ) ) {
$review_count = isset( $product ) ? $product->get_review_count() : '';
$review_count_search = !empty($review_count) ? "($review_count)" : '';
$review_count_replace = !empty($review_count) ? "<span>$review_count</span>" : '';

$title = trim( str_replace($review_count_search, '', $title) ) . $review_count_replace;
$title = trim( str_replace($review_count_search, '', $title) ) . $review_count_replace;
}
}
return '<i class="fa fa-star"></i>' . $title;
}
Expand Down

0 comments on commit 5a87171

Please sign in to comment.