';
echo '
';
if (!empty($term->description)) {
echo '';
}
echo '' . esc_html(sprintf(esc_html__('%s products', 'xshop'), number_format_i18n((int) $term->count))) . '
';
echo '';
}
} elseif (is_shop()) {
$shopId = wc_get_page_id('shop');
$title = $shopId ? get_the_title($shopId) : esc_html__('Shop', 'xshop');
echo '';
}
do_action('woocommerce_before_shop_loop');
if (woocommerce_product_loop()) {
woocommerce_product_loop_start();
if (wc_get_loop_prop('is_shortcode')) {
$columns = absint(wc_get_loop_prop('columns'));
} else {
$columns = absint(get_option('woocommerce_catalog_columns', 4));
}
while (have_posts()) {
the_post();
do_action('woocommerce_shop_loop');
wc_get_template_part('content', 'product');
}
woocommerce_product_loop_end();
do_action('woocommerce_after_shop_loop');
} else {
do_action('woocommerce_no_products_found');
// Enhanced empty state for shop/category
get_template_part('template-parts/components/empty-state', null, [
'title' => esc_html__('No products found', 'xshop'),
'text' => esc_html__('Try adjusting your filters or browse all products.', 'xshop'),
'cta_label' => esc_html__('Browse shop', 'xshop'),
'cta_url' => wc_get_page_permalink('shop'),
]);
}
do_action('woocommerce_after_main_content');
get_footer('shop');