Notifications
Clear all

Paid Addons Support Forum Only

Please note, that here we only support Paid Addons issues and questions.

gVectors Support staff works from 6am to 6pm (GMT+0)

All questions related to wpForo and wpDiscuz free plugins should be asked in the corresponding plugin support forum:

 

wpDiscuz Support Forum   wpForo Support Forum

[Solved] Comments Count  

  RSS

yoannc
(@yoannc)
Active Member
Joined: 1 week ago
Posts: 5
16/11/2020 3:55 pm  

Hi there,

By default, there is a space between the title and the number of comments in the tab label. Since the installation of the WooDiscuz plugin, this space has been deleted, both in the "Reviews" tab and in the "Discussions" tab. How to restore it?

Thank you

tabs

 


Astghik
(@astghik)
Support Team Admin
Joined: 3 years ago
Posts: 4512
16/11/2020 4:46 pm  

@yoannc,

Could you please leave some example URL? Also please leave a screenshot of how it looks before the WooDiscuz plugin installed. 


yoannc
(@yoannc)
Active Member
Joined: 1 week ago
Posts: 5
16/11/2020 8:54 pm  

@astghik

I corrected the Discussions tab of the plugin by leaving a last space after the name of the Disscussion Tab Title field: "Discussions "

Regarding the Reviews tab, it's your plugin that removes the space. I noticed it after deactivating / reactivating WooDiscuz.

There is a hook to change the name of this tab:

add_filter( 'woocommerce_product_tabs', 'rename_reviews_tab' );

function rename_reviews_tab( $tabs ) {
global $product;
$tabs['reviews']['title'] = 'Customer Reviews (' . $product->get_review_count() . ') ';
return $tabs;
}

This snippets works as normal, but not when your plugin is activated.

screen tabs

 


yoannc
(@yoannc)
Active Member
Joined: 1 week ago
Posts: 5
17/11/2020 1:09 pm  

I found a temporary solution, not the cleanest, but functional:

/**
* Remove product data tabs
*/
add_filter( 'woocommerce_product_tabs', 'woo_remove_product_tabs', 98 );

function woo_remove_product_tabs( $tabs ) {

// unset( $tabs['description'] ); // Remove the description tab
unset( $tabs['reviews'] ); // Remove the reviews tab
unset( $tabs['additional_information'] ); // Remove the additional information tab

return $tabs;
}

/**
* Add a custom product data tab
*/
add_filter( 'woocommerce_product_tabs', 'woo_new_product_tab' );
function woo_new_product_tab( $tabs ) {

// Adds the new tab

$tabs['test_tab'] = array(
'title' => __( 'Reviews (' . $product->get_review_count() . ')', 'woocommerce' ),
'priority' => 50,
'callback' => 'woo_new_product_tab_content'
);

return $tabs;

}
function woo_new_product_tab_content() {

// The new tab content

echo do_shortcode('[cusrev_reviews]');

}

I am waiting if you have a better solution.


yoannc
(@yoannc)
Active Member
Joined: 1 week ago
Posts: 5
17/11/2020 11:43 pm  

@astghik

After some tests, it is possible to rename the "Description" and "Additional Information" tabs with the hooks provided by WooCommerce but not with the "Reviews" tab.

add_filter( 'woocommerce_product_tabs', 'rename_description_tab' );
function rename_description_tab( $tabs ) {
$tabs['description']['title'] = 'About';
return $tabs;
}

Renaming "Description" works in all cases.

add_filter( 'woocommerce_product_tabs', 'rename_additional_info_tab' );
function rename_additional_info_tab( $tabs ) {
$tabs['additional_information']['title'] = 'More Info';
return $tabs;
}

Renaming "Additional Info" works in all cases.

add_filter( 'woocommerce_product_tabs', 'rename_reviews_tab' );
function rename_reviews_tab( $tabs ) {
global $product;
$tabs['reviews']['title'] = 'Customer Reviews (' . $product->get_review_count() . ')';
return $tabs;
}

Renaming "Reviews (x)" only works when WooDiscuz is disabled.

add_filter( 'woocommerce_product_tabs', 'replace_reviews_tab' );
function replace_reviews_tab( $tabs ) {
$tabs['reviews']['title'] = str_replace( 'Reviews', 'Customer Reviews', $tabs['reviews']['title'] );
return $tabs;
}

Replace "Reviews" only works when WooDiscuz is disabled.

I can't use the method described in my previous post because I am getting new issues.

I need a solution urgently enough.

Thanks.


Astghik
(@astghik)
Support Team Admin
Joined: 3 years ago
Posts: 4512
18/11/2020 12:28 pm  

@yoannc,

Please follow the steps below:

1. Open the wp-content/plugins/woodiscuz/wpc.php file

2. Find the 219 line

3. Replace the code in the line with this one:

return _e('Reviews', 'woocommerce') . ' (' . $this->reviews_count . ')';

yoannc
(@yoannc)
Active Member
Joined: 1 week ago
Posts: 5
18/11/2020 1:07 pm  

Great, that fixes the problem. Thanks!

It would be nice to fix it in a future update.

Thank you again!


Astghik
(@astghik)
Support Team Admin
Joined: 3 years ago
Posts: 4512
19/11/2020 12:15 pm  

Yes, the changes will be included in the next version. 


Share:
Scroll to top