add-to-cart.php
5 years ago
loop-end.php
5 years ago
loop-start.php
5 years ago
no-products-found.php
5 years ago
orderby.php
5 years ago
pagination.php
5 years ago
price.php
5 years ago
rating.php
5 years ago
result-count.php
5 years ago
sale-flash.php
5 years ago
result-count.php
41 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Result Count |
| 4 | * |
| 5 | * Shows text: Showing x - x of x results. |
| 6 | * |
| 7 | * This template can be overridden by copying it to yourtheme/woocommerce/loop/result-count.php. |
| 8 | * |
| 9 | * HOWEVER, on occasion WooCommerce will need to update template files and you |
| 10 | * (the theme developer) will need to copy the new files to your theme to |
| 11 | * maintain compatibility. We try to do this as little as possible, but it does |
| 12 | * happen. When this occurs the version of the template file will be bumped and |
| 13 | * the readme will list any important changes. |
| 14 | * |
| 15 | * @see https://docs.woocommerce.com/document/template-structure/ |
| 16 | * @package WooCommerce\Templates |
| 17 | * @version 3.7.0 |
| 18 | */ |
| 19 | |
| 20 | if ( ! defined( 'ABSPATH' ) ) { |
| 21 | exit; |
| 22 | } |
| 23 | ?> |
| 24 | <p class="woocommerce-result-count"> |
| 25 | <?php |
| 26 | // phpcs:disable WordPress.Security |
| 27 | if ( 1 === intval( $total ) ) { |
| 28 | _e( 'Showing the single result', 'woocommerce' ); |
| 29 | } elseif ( $total <= $per_page || -1 === $per_page ) { |
| 30 | /* translators: %d: total results */ |
| 31 | printf( _n( 'Showing all %d result', 'Showing all %d results', $total, 'woocommerce' ), $total ); |
| 32 | } else { |
| 33 | $first = ( $per_page * $current ) - $per_page + 1; |
| 34 | $last = min( $total, $per_page * $current ); |
| 35 | /* translators: 1: first result 2: last result 3: total results */ |
| 36 | printf( _nx( 'Showing %1$d–%2$d of %3$d result', 'Showing %1$d–%2$d of %3$d results', $total, 'with first and last result', 'woocommerce' ), $first, $last, $total ); |
| 37 | } |
| 38 | // phpcs:enable WordPress.Security |
| 39 | ?> |
| 40 | </p> |
| 41 |