Result count php woocommerce

Themeco Community

Hi I’ve searched the forum and Google, but can’t find a solution. It seems that the products results count doesn’t work when there is only 1 page of results. The paragraph still shows with the borders, but there is no content. When there are more results it displays correctly with “Showing x-y of z results”. I shared the website and login details in a previous post (https://community.theme.co/forums/topic/layout-within-slider-not-working/#post-1090124). An example is if you go to click on the CBD category or a filter. Please let me know if you need any further information. Thanks!

Hi, I’ve updated everything, but the problem’s still the same unfortunately. Any help would be appreciated.

Hi There, Upon checking your setup, it is showing the complete shop list or product list. Would you mind confirming if it is okay already. Please clear your site and browser cache upon checking. Thanks.

Hi I cleared my browser cache and it’s still not showing when there is 1 page of items, whether I use the filter or click on the CBD category. I also checked in another browser which I hadn’t used for the site before.

Hi There, I can see that it is just a square and missing the content. The content of that box should be Showing all 7 results. You could try testing for a plugin conflict. You can do this by deactivating all third party plugins, and seeing if the problem remains. If it’s fixed, you’ll know a plugin caused the problem, and you can narrow down which one by reactivating them one at a time. If not a plugin conflict, please do switch from your child theme to your main X theme. Just so we can check that this is not a result of any customization. Don’t forget to save a backup of your site before doing this. If it shows after that, you can activate the child theme again but this time, add each file or function one by one so we can see which one was causing the issue.
Do let us know how this goes.

Читайте также:  Css параметры для изображений

Hi I deactivated all plugins and removed the child theme, but the text still didn’t show. Please let me know what else I can do to fix it. Thanks!

Hi There, Do you have a caching on your hosting? This might be cache.
The code responsible for this can be found here:wp-content\plugins\woocommerce\templates\loop\result-count.php. We don’t have any customization regarding this part and it is complete woocommerce. This is the entire content:

 global $wp_query; if ( ! woocommerce_products_will_display() ) return; ?> 

 printf( _n( 'Showing the single result', 'Showing all %d results', $total, 'woocommerce' ), $total ); 

Hi I changed that line, based on the next line, to : printf( _n( ‘Showing the single result’, ‘Showing all %d results’, $total, ‘%d = total’, ‘woocommerce’ ), $total ); and now it’s showing. The variable %d wasn’t defined. Thanks so much for your help!

Источник

How to remove the WooCommerce results count

how-to-remove-the-woocommerce-results-count

Looking for a way to remove the WooCommerce results count? This is the result text that shows up on the WooCommerce product archive pages that displays the amount of products you are currently viewing and the total amount of products in your current query. Removing it is simple. Just copy and paste this snippet into your WordPress themes functions.php file and you’re good to go!

This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters

// Remove the result count from WooCommerce
remove_action( ‘woocommerce_before_shop_loop’ , ‘woocommerce_result_count’ , 20 );

Share the knowledge!

I hope this article has helped you in your web design/development journey! If you found it helpful, share it on your socials!

Jordan

Jordan is a web designer, developer and SEO. He believes in providing honest and reliable web design services to businesses of any size. Regardless of the size of the project, he seeks to provide consistent quality. Jordan is an Army veteran and is proud to have served his country. He is husband to a beautiful, Godly woman, Megan and father to four beautiful girls: Kaysie, Kinley, Kylee and Katy.

Reader Interactions

Comments

Hi Warren, My guess is that your included the opening PHP tag in the code but the location that you added the code to already had an opening PHP tag. If that is the case you would need to only add the code below the PHP tag from the code snippet. If you add another opening PHP tag inside of that block it will trigger a fatal error and crash the entire site.

Hi Roel, You could try using this in combination with the WordPress wp_is_mobile() function. Or you could just hide it from view in mobile devices using CSS Media Queries. Thanks!

Leave a Reply Cancel reply

Primary Sidebar

Web Design Services

Newsletter Signup

Get ongoing web design tips and design inspiration from my blog!

About Jordan Smith

portfolio to view some of my work, learn more about my philosophy or if you’re ready to get started, contact me now to discuss your project!

Categories

  • Blogging
  • Cyber Security
  • Marketing
  • SEO
  • Web Design
  • Web Development
    • ACF Development
    • BX Slider
    • Genesis Development
    • Gravity Forms Development
    • jQuery Development
    • Materialize Development
    • WooCommerce Development
    • WordPress Development

    how-to-remove-the-woocommerce-sorting-dropdown

    How to remove the WooCommerce sorting dropdown Looking for a way to remove the WooCommerce sorting dropdown? This is the dropdown that shows up on the WooCommerce product archive pages that allows you to sort your products…Learn More

    useful-woocemmerce-snippets

    Useful WooCommerce Snippets This is a running list of snippets and plugins that I’ve found useful while developing in WooCommerce. If you are using the WC Brands extension, you will quicly realize that…Learn More

    how-to-change-or-remove-the-product-description-title-

    How to Change or Remove the Product Description Title in WooCommerce Looking for a simple way to Change or Remove the Product Description Title in WooCommerce? I’ve got you covered! Simply add one of the two snippets below to your functions.php…Learn More

    Ready To Get Started?

    Have a look at my web design portfolio, view my web design services or read reviews from my clients.

    If you’re interested in hiring me, use the contact form below to shoot me an email with some details on your project.

    Источник

    Убрать надпись «Показаны все товары. Всего товаров: » с каталога товаров woocommerce

    Woocommerce — как изменить надпись «Архив товаров» в заголовке?
    Собственно вопрос — Woocommerce — как изменить надпись "Архив товаров" в заголовке? Допустим, на.

    Для товаров, находящихся на отдельном листе «Товары», найти и сопоставить цены из листа «Прайс»
    Нужно решить 2 теста, у меня нет офиса, только онлайн. Как это можно решить в онлайн офисе.

    Когда после проведения инвентаризации товаров требуется оформить документ «Оприходование товаров»?
    В каком случае после проведения инвентаризации товаров на складе требуется оформить документ.

    ЦитатаСообщение от andreyprog Посмотреть сообщение

    Привет, как можно Убрать надпись «Показаны все товары. Всего товаров: » с каталога товаров woocommerce

    так, в том то и дело, что я не могу его найти(( если надо могу скинуть папку с файлами, мб, кто что-то подскажет.

    ЦитатаСообщение от andreyprog Посмотреть сообщение

    так, в том то и дело, что я не могу его найти(( если надо могу скинуть папку с файлами, мб, кто что-то подскажет.

    я его уже когда кидал сюда, он находиться по ссылке Плагин WooCommerce, где находится функция отзывов?

    ЦитатаСообщение от andreyprog Посмотреть сообщение

    ЦитатаСообщение от andreyprog Посмотреть сообщение

    Вижу такое только в файле: ../woocommerce/templates/loop/result-count.php

    Попробуй вообще удалить в этом файле блок, что ниже (не забудь тока копию файла сделать, или кода перед этим )) ):

    1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17

    $paged = max( 1, $wp_query->get( 'paged' ) ); $per_page = $wp_query->get( 'posts_per_page' ); $total = $wp_query->found_posts; $first = ( $per_page * $paged ) - $per_page + 1; $last = min( $total, $wp_query->get( 'posts_per_page' ) * $paged ); if ( 1 == $total ) { _e( 'Showing the single result', 'woocommerce' ); } elseif ( $total $per_page || -1 == $per_page ) { printf( __( 'Showing all %d results', 'woocommerce' ), $total ); } else { printf( _x( 'Showing %1$d–%2$d of %3$d results', '%1$d = first, %2$d = last, %3$d = total', 'woocommerce' ), $first, $last, $total ); } ?>

    Источник

Оцените статью