ruạṛ
<?php /** * Product Archive / Catalog Page */ get_header(); ?> <div class="breadcrumbs"> <div class="breadcrumbs-inner"> <a href="<?php echo home_url('/'); ?>">Home</a> <span class="separator">›</span> <?php if (is_tax('product_category')): ?> <a href="<?php echo get_post_type_archive_link('product'); ?>">Catalogue</a> <span class="separator">›</span> <span> <?php single_term_title(); ?> </span> <?php else: ?> <span>Catalogue</span> <?php endif; ?> </div> </div> <div class="catalog-header"> <div class="container"> <?php if (is_tax('product_category')): ?> <h1> <?php single_term_title(); ?> </h1> <?php if (term_description()): ?> <p> <?php echo term_description(); ?> </p> <?php endif; ?> <?php else: ?> <h1>Product Catalogue</h1> <p>Browse our full range of agricultural harvester parts and equipment</p> <?php endif; ?> </div> </div> <div class="catalog-layout"> <!-- Sidebar --> <aside class="catalog-sidebar"> <div class="sidebar-widget"> <h3>Categories</h3> <ul class="category-filter-list"> <li> <a href="<?php echo get_post_type_archive_link('product'); ?>" class="<?php echo !is_tax('product_category') ? 'active' : ''; ?>"> All Products <span class="count"> <?php echo wp_count_posts('product')->publish; ?> </span> </a> </li> <?php $cats = ie_get_product_categories(); if (!is_wp_error($cats)) { foreach ($cats as $cat) { $active = (is_tax('product_category', $cat->slug)) ? 'active' : ''; echo '<li><a href="' . get_term_link($cat) . '" class="' . $active . '">'; echo esc_html($cat->name); echo '<span class="count">' . $cat->count . '</span>'; echo '</a></li>'; } } ?> </ul> </div> <div class="sidebar-widget"> <h3>Need Help?</h3> <p style="font-size:0.85rem;color:var(--color-text-light);margin-bottom:1rem;">Can't find what you're looking for? We can source parts for most harvester brands.</p> <a href="<?php echo home_url('/contact/'); ?>" class="btn btn-primary btn-sm" style="width:100%;justify-content:center;">Contact Us</a> </div> </aside> <!-- Product Grid --> <div class="catalog-main"> <?php if (have_posts()): ?> <div class="products-grid"> <?php while (have_posts()): the_post(); ?> <div class="product-card reveal"> <a href="<?php the_permalink(); ?>" class="product-card-image"> <?php if (has_post_thumbnail()): ?> <?php the_post_thumbnail('product-thumb'); ?> <?php else: ?> <svg width="48" height="48" fill="none" stroke="#ccc" stroke-width="1.5" viewBox="0 0 24 24"> <circle cx="12" cy="12" r="3" /> <path d="M12 2v4M12 18v4M4.93 4.93l2.83 2.83M16.24 16.24l2.83 2.83M2 12h4M18 12h4M4.93 19.07l2.83-2.83M16.24 7.76l2.83-2.83" /> </svg> <?php endif; ?> </a> <div class="product-card-body"> <h3><a href="<?php the_permalink(); ?>" style="color:inherit;text-decoration:none;"> <?php the_title(); ?> </a></h3> <?php $part_number = get_post_meta(get_the_ID(), '_ie_part_number', true); ?> <?php if ($part_number): ?> <div class="part-number"> <?php echo esc_html($part_number); ?> </div> <?php endif; ?> <?php $short_desc = get_post_meta(get_the_ID(), '_ie_short_description', true); ?> <p> <?php echo $short_desc ? esc_html($short_desc) : wp_trim_words(get_the_excerpt(), 15); ?> </p> </div> <div class="product-card-actions"> <a href="<?php the_permalink(); ?>" class="btn btn-outline btn-sm">View Details</a> </div> </div> <?php endwhile; ?> </div> <div class="pagination"> <?php the_posts_pagination(array( 'mid_size' => 2, 'prev_text' => '← Prev', 'next_text' => 'Next →', )); ?> </div> <?php else: ?> <div style="text-align:center;padding:4rem 2rem;"> <svg width="64" height="64" fill="none" stroke="#ccc" stroke-width="1.5" viewBox="0 0 24 24"> <circle cx="12" cy="12" r="3" /> <path d="M12 2v4M12 18v4M4.93 4.93l2.83 2.83M16.24 16.24l2.83 2.83M2 12h4M18 12h4M4.93 19.07l2.83-2.83M16.24 7.76l2.83-2.83" /> </svg> <h2 style="margin-top:1rem;">No products found</h2> <p style="color:var(--color-text-light);margin:0.5rem 0 1.5rem;">Products will appear here once they are added to the catalogue.</p> <a href="<?php echo home_url('/contact/'); ?>" class="btn btn-primary">Contact Us For Parts</a> </div> <?php endif; ?> </div> </div> <?php get_footer(); ?>
cải xoăn