The effects of alcohol on sustanon 250 leucine for – real weight loss & bodybuilding benefits?
Woocommerce Comment...
 
Share:
Notifications
Clear all

Woocommerce Comment counts are Zero after update

8 Posts
3 Users
0 Likes
1,369 Views
Posts: 2
Topic starter
(@jjk100479)
New Member
Joined: 4 years ago

Hi, WP Discuz

I am not sure from when, but the comments count (of woocommerce) is changed to Zero when the new comment is added.

Could you help me to check how to fix it..

https://www.oppadu.com/product/%ec%97%91%ec%85%80-%eb%8b%a8%ec%96%b4%ec%9e%a5-%ed%85%8c%ec%8a%a4%ed%8a%b8-%ec%96%91%ec%8b%9d/

Thank you,

Best regards,

Topic Tags
7 Replies
Asti
Posts: 7114
 Asti
Support
(@asti)
Illustrious Member
Joined: 6 years ago

Hi @jjk100479

Please follow the steps below:

  1. Navigate to Dashboard > wpDiscuz > Forms admin page 
  2. Edit the current form
  3. Edit the Rating field you've created
  4. Find and click on the "Advanced Options" link
  5. Fill "rating" as a value of the "Meta Key" field. 
rating
Reply
2 Replies
(@jjk100479)
Joined: 4 years ago

New Member
Posts: 2

@asti Hi, asti

Thank you for quick reply.

However, I am sorry to say you that the Comment count is still Zero after changing the meta-key.

May I ask if there is any possible issue? Thank you..!

Reply
Asti
 Asti
Support
(@asti)
Joined: 6 years ago

Illustrious Member
Posts: 7114

@jjk100479,

This count is being displayed by WooCommerce not wpDiscuz side. You should contact the WooCommerce support with this question.  

Reply
Posts: 2
(@hacker-s2h)
New Member
Joined: 3 years ago

time to end of this ....... problem in public

I Hope WPDiscuz Fix This Bug in New Plugin Update.

ways for do that

We Can Fix Review Count For WooCommerce With Changing

 

$review_count = $product->get_review_count();

esc_html( $review_count ) or echo $review_count

 

To

 

$post_id = get_the_ID();

$review_count = wp_count_comments( $post_id );

echo $review_count->total_comments;

 

in any where of your theme or in the woocommerce plugin templates

this is done.sample is here....

1

Fix Review Count in Review Tab(Title)

go to your theme directory :

wp-content/themes/YOUR-THEME-NAME/woocommerce/single-product/tabs/tabs.php

and add this commands to first of your code :

 

add_filter( 'woocommerce_product_tabs', 'misha_rename_additional_info_tab' );
function misha_rename_additional_info_tab( $tabs ) {
$post_id = get_the_ID();
$review_count = wp_count_comments( $post_id );
$tabs['reviews']['title'] = ' Revieeeeews '.'('. $review_count->total_comments.')' ;
return $tabs;
}

this is easy way for rename tabs,we use of this point for our target.
tab renamed but i add little change for counter comments too.

2

Fix Rating file
go to your theme directory :
wp-content/themes/YOUR-THEME-NAME/woocommerce/single-product/rating.php
and update your code like this sample :

<?php
/**
* Single Product Rating
*
* This template can be overridden by copying it to yourtheme/woocommerce/single-product/rating.php.
*
* HOWEVER, on occasion WooCommerce will need to update template files and you
* (the theme developer) will need to copy the new files to your theme to
* maintain compatibility. We try to do this as little as possible, but it does
* happen. When this occurs the version of the template file will be bumped and
* the readme will list any important changes.
*
* @see https://docs.woocommerce.com/document/template-structure/
* @package WooCommerce/Templates
* @version 3.6.0
*/

if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly
}

global $product;

if ( ! wc_review_ratings_enabled() ) {
return;
}
$post_id = get_the_ID();
$review_count = wp_count_comments( $post_id );
$rating_count = $product->get_rating_count();
$average = $product->get_average_rating();

$review_link = apply_filters('gon_woocommerce_review_link_filter', '#comments');
$comments_count = wp_count_comments( $post->ID );
if ( esc_html($comments_count->approved)-1 > 1 ) : ?>

<div class="woocommerce-product-rating">
<?php echo wc_get_rating_html( $average, $rating_count ); ?>
<?php if ( comments_open() ) : ?>
<a href="<?php echo esc_url($review_link); ?>" class="woocommerce-review-link" rel="nofollow">
<span class="count"> Reviews(<?php echo $review_count->total_comments; ?>) </span></a><?php endif ?>
</div>

<?php else: ?>

<div class="woocommerce-product-rating">
<?php if ( comments_open() ) : ?>
<a href="<?php echo esc_url($review_link); ?>" class="woocommerce-review-link" rel="nofollow">
<?php esc_html_e( 'Write your comment', 'gon' ); ?></a><?php endif; ?>
</div>

<?php endif; ?>

Updates :

 

$review_count = $product->get_review_count();

esc_html( $review_count ) or echo $review_count

 

To

 

$post_id = get_the_ID();

$review_count = wp_count_comments( $post_id );

echo $review_count->total_comments;

3

you can fix this problem directly in woocommerce plugin too(template dir)
if anyone need to more guide for doing this way say to me in comments or mail to me :
hacker.s2h@gmail.com
I will explain later.I'm not bored right now 😐

Good NEWS : Ioncube Decoder v10 PHP 7.2 Public Soon in There :


https://kamyabdlshop.ir

Reply
3 Replies
Asti
 Asti
Support
(@asti)
Joined: 6 years ago

Illustrious Member
Posts: 7114

@hacker-s2h,

The issue has already been fixed in the latest version of the wpDiscuz plugin. 

Reply
(@hacker-s2h)
Joined: 3 years ago

New Member
Posts: 2

@astilast 

i have update but not fixed.

Reply
Asti
 Asti
Support
(@asti)
Joined: 6 years ago

Illustrious Member
Posts: 7114

@hacker-s2h,

Once some review is added for the product it'll update the count. 

Reply
Share: