84 lines
2.2 KiB
PHP
84 lines
2.2 KiB
PHP
<?php
|
|
/**
|
|
* نتایج جستجوی محصول — ?s=...&post_type=product
|
|
*
|
|
* @package Hesabix2
|
|
*/
|
|
|
|
defined( 'ABSPATH' ) || exit;
|
|
|
|
get_header();
|
|
|
|
$query = get_search_query();
|
|
global $wp_query;
|
|
?>
|
|
|
|
<div id="woocommerce-primary" class="hesabix-wc page-wrap woocommerce hesabix-wc-product-search">
|
|
<div class="page-outer">
|
|
<div class="hesabix-wc__shell max-w-none mx-auto">
|
|
<main id="woocommerce-main" class="hesabix-wc__main" role="main">
|
|
<div class="page-card hesabix-wc__card">
|
|
<?php if ( function_exists( 'hesabix2_wc_render_breadcrumb' ) ) : ?>
|
|
<?php hesabix2_wc_render_breadcrumb(); ?>
|
|
<?php endif; ?>
|
|
|
|
<header class="woocommerce-products-header hesabix-wc-search-header">
|
|
<h1 class="woocommerce-products-header__title page-title">
|
|
<?php
|
|
if ( $query ) {
|
|
printf(
|
|
/* translators: %s: search query */
|
|
esc_html__( 'جستجوی محصول: «%s»', 'hesabix2' ),
|
|
esc_html( $query )
|
|
);
|
|
} else {
|
|
esc_html_e( 'جستجوی محصول', 'hesabix2' );
|
|
}
|
|
?>
|
|
</h1>
|
|
<div class="hesabix-wc-search-header__form">
|
|
<?php get_product_search_form(); ?>
|
|
</div>
|
|
</header>
|
|
|
|
<?php if ( woocommerce_product_loop() ) : ?>
|
|
|
|
<div class="woocommerce-before-shop-loop hesabix-wc-shop-toolbar">
|
|
<div class="hesabix-wc-shop-toolbar__search" role="search">
|
|
<?php get_product_search_form(); ?>
|
|
</div>
|
|
<p class="woocommerce-result-count" role="status">
|
|
<?php
|
|
printf(
|
|
/* translators: %s: number of results */
|
|
esc_html( _n( '%s محصول', '%s محصول', (int) $wp_query->found_posts, 'hesabix2' ) ),
|
|
esc_html( number_format_i18n( (int) $wp_query->found_posts ) )
|
|
);
|
|
?>
|
|
</p>
|
|
</div>
|
|
|
|
<?php woocommerce_product_loop_start(); ?>
|
|
|
|
<?php
|
|
while ( have_posts() ) :
|
|
the_post();
|
|
wc_get_template_part( 'content', 'product' );
|
|
endwhile;
|
|
?>
|
|
|
|
<?php woocommerce_product_loop_end(); ?>
|
|
|
|
<?php woocommerce_pagination(); ?>
|
|
|
|
<?php else : ?>
|
|
<?php wc_get_template( 'loop/no-products-found.php' ); ?>
|
|
<?php endif; ?>
|
|
</div>
|
|
</main>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<?php
|
|
get_footer();
|