0
A
回答
0
Woocommerce已經顯示評論數旁邊星級單品頁。但在商店和檔案頁面上,它只顯示星級評分。即使在商店和檔案頁面上,按照以下步驟顯示星級評分。
步驟1)創建你的主題的根一個新的文件夾並將其命名爲「woocommerce」
步驟2)在新創建的「woocommerce」文件夾並將其命名爲「環」
創建一個新的文件夾步驟3)添加「rating.php」文件到新創建的「迴路」文件夾
現在你的目錄會是這個樣子
/的public_html /可溼性粉劑內容/主題/你的主題/ woocommerce /循環
下面的代碼添加到新創建的「rating.php」,並根據您的需要進行定製。
<?php
/**
* Loop Rating
*
* This template can be overridden by copying it to yourtheme/woocommerce/loop/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/
* @author WooThemes
* @package WooCommerce/Templates
* @version 3.0.0
*/
if (! defined('ABSPATH')) {
exit;
}
global $product;
if (get_option('woocommerce_enable_review_rating') === 'no') {
return;
}
$rating_count = $product->get_rating_count();
$review_count = $product->get_review_count();
$average = $product->get_average_rating();
if ($rating_count >= 0) : ?>
<?php echo wc_get_rating_html($average, $rating_count); ?>
<?php if (comments_open()): ?><a href="<?php echo get_permalink() ?>#reviews" class="woocommerce-review-link" rel="nofollow">(<?php printf(_n('%s',$review_count,'woocommerce'), '<span class="count">' . esc_html($review_count) . '</span>'); ?>)</a><?php endif ?>
<?php endif; ?>
在這種情況下,不「woocommerce」文件夾工作
添加「模板」文件夾,然後在「模板」文件夾中添加「迴路」文件夾中。
現在的目錄應該是這樣
/的public_html /可溼性粉劑內容/主題/你的主題/ woocommerce /模板/循環
相關問題
- 1. 顯示星上評級
- 2. 顯示評級星xcode
- 3. 循環顯示星級評分
- 4. 如何在谷歌搜索結果中顯示評論星級評分
- 5. 顯示評分以前評論
- 6. Woocommerce評論顯示在標籤後面
- 7. JavaScript - 顯示保存的評論名稱和評論顯示在彼此的旁邊,而不是頂部?
- 8. rails星級評分系統 - ajaxful評級
- 9. CakePHP星級評分
- 10. CSS星級評分
- 11. 在laravel顯示多個評級星級jquery酒吧評級5
- 12. 將星級評分添加到Django評論
- 13. 根據子分評論根據子分評論顯示
- 14. 評論無效woocommerce
- 15. 星級評定懸停獨立的每個星級評分
- 16. WooCommerce將「SSSSS」基於文本的評分改爲默認星級評分
- 17. Jquery的星級評分
- 18. 星不顯示的jQuery吧評級
- 19. 如何更改WooCommerce中S的評論評級?
- 20. Java Youtube API評級評論
- 21. 星級評分系統
- 22. Angular 5星級評分欄
- 23. 單星級評分條碼
- 24. 星級評分系統html
- 25. Laravel - 星級評分 - 優化?
- 26. 星級評分系統(jQuery)
- 27. 星級評分系統
- 28. 語義星級評分
- 29. 顯示評論的某些部分 - Magento
- 30. 如何在文本標籤旁邊放置星級評分圖片