Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1091820

    brett kramer
    Participant

    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!

    #1091833

    Christopher
    Moderator

    Hi there,

    Pleas update your theme and plugins as this may fix your issue.

    Thanks.

    #1092040

    brett kramer
    Participant

    Hi,

    I’ve updated everything, but the problem’s still the same unfortunately.

    Any help would be appreciated.

    #1092325

    Nico
    Moderator

    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.

    #1092546

    brett kramer
    Participant

    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.

    #1092993

    Lely
    Moderator

    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.

    #1093277

    brett kramer
    Participant

    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!

    #1093425

    Lely
    Moderator

    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:

    <?php
    /**
     * Result Count
     *
     * Shows text: Showing x - x of x results.
     *
     * This template can be overridden by copying it to yourtheme/woocommerce/loop/result-count.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.woothemes.com/document/template-structure/
     * @author 		WooThemes
     * @package 	WooCommerce/Templates
     * @version     2.0.0
     */
    
    if ( ! defined( 'ABSPATH' ) ) {
    	exit; // Exit if accessed directly
    }
    
    global $wp_query;
    
    if ( ! woocommerce_products_will_display() )
    	return;
    ?>
    <p class="woocommerce-result-count">
    	<?php
    	$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 ( $total <= $per_page || -1 === $per_page ) {
    		printf( _n( 'Showing the single result', 'Showing all %d results', $total, 'woocommerce' ), $total );
    	} else {
    		printf( _nx( 'Showing the single result', 'Showing %1$d&ndash;%2$d of %3$d results', $total, '%1$d = first, %2$d = last, %3$d = total', 'woocommerce' ), $first, $last, $total );
    	}
    	?>
    </p>
    
    

    The code responsible for that part is this:

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

    It’s on line 39. Please check if it’s the same.

    Hope this helps.

    #1094210

    brett kramer
    Participant

    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!

    #1094638

    John Ezra
    Member

    You’re most welcome! Glad you got it to work!

    #1117058

    dihetherington
    Participant
    This reply has been marked as private.
    #1117061

    dihetherington
    Participant
    This reply has been marked as private.
    #1117393

    Rahul
    Moderator

    Hey There,

    Would you mind providing us with login credentials so we can take a closer look? To do this, you can make a post with the following info:

    – WordPress Admin username / password

    Don’t forget to select Set as private reply. This ensures your information is only visible to our staff.

    Thanks.