add-to-cart.php
1 year ago
header.php
2 years ago
loop-end.php
2 years ago
loop-start.php
2 years ago
no-products-found.php
2 years ago
orderby.php
1 year ago
pagination.php
1 year ago
price.php
2 years ago
rating.php
2 years ago
result-count.php
1 year ago
sale-flash.php
2 years ago
result-count.php
43 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://woocommerce.com/document/template-structure/ |
| 16 | * @package WooCommerce\Templates |
| 17 | * @version 9.9.0 |
| 18 | */ |
| 19 | |
| 20 | if ( ! defined( 'ABSPATH' ) ) { |
| 21 | exit; |
| 22 | } |
| 23 | ?> |
| 24 | <p class="woocommerce-result-count" role="alert" aria-relevant="all" <?php echo ( empty( $orderedby ) || 1 === intval( $total ) ) ? '' : 'data-is-sorted-by="true"'; ?>> |
| 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 | $orderedby_placeholder = empty( $orderedby ) ? '%2$s' : '<span class="screen-reader-text">%2$s</span>'; |
| 31 | /* translators: 1: total results 2: sorted by */ |
| 32 | printf( _n( 'Showing all %1$d result', 'Showing all %1$d results', $total, 'woocommerce' ) . $orderedby_placeholder, $total, esc_html( $orderedby ) ); |
| 33 | } else { |
| 34 | $first = ( $per_page * $current ) - $per_page + 1; |
| 35 | $last = min( $total, $per_page * $current ); |
| 36 | $orderedby_placeholder = empty( $orderedby ) ? '%4$s' : '<span class="screen-reader-text">%4$s</span>'; |
| 37 | /* translators: 1: first result 2: last result 3: total results 4: sorted by */ |
| 38 | 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' ) . $orderedby_placeholder, $first, $last, $total, esc_html( $orderedby ) ); |
| 39 | } |
| 40 | // phpcs:enable WordPress.Security |
| 41 | ?> |
| 42 | </p> |
| 43 |