auth
1 year ago
block-notices
1 year ago
brands
1 year ago
cart
10 months ago
checkout
11 months ago
emails
9 months ago
global
10 months ago
loop
1 year ago
myaccount
10 months ago
notices
9 months ago
order
10 months ago
parts
9 months ago
product-form
1 year ago
single-product
9 months ago
templates
11 months ago
archive-product.php
2 years ago
content-product-cat.php
2 years ago
content-product.php
1 year ago
content-single-product.php
2 years ago
content-widget-price-filter.php
2 years ago
content-widget-product.php
2 years ago
content-widget-reviews.php
2 years ago
product-searchform.php
2 years ago
single-product-reviews.php
1 year ago
single-product.php
2 years ago
taxonomy-product-attribute.php
2 years ago
taxonomy-product-cat.php
2 years ago
taxonomy-product-tag.php
2 years ago
archive-product.php
98 lines
| 1 | <?php |
| 2 | /** |
| 3 | * The Template for displaying product archives, including the main shop page which is a post type archive |
| 4 | * |
| 5 | * This template can be overridden by copying it to yourtheme/woocommerce/archive-product.php. |
| 6 | * |
| 7 | * HOWEVER, on occasion WooCommerce will need to update template files and you |
| 8 | * (the theme developer) will need to copy the new files to your theme to |
| 9 | * maintain compatibility. We try to do this as little as possible, but it does |
| 10 | * happen. When this occurs the version of the template file will be bumped and |
| 11 | * the readme will list any important changes. |
| 12 | * |
| 13 | * @see https://woocommerce.com/document/template-structure/ |
| 14 | * @package WooCommerce\Templates |
| 15 | * @version 8.6.0 |
| 16 | */ |
| 17 | |
| 18 | defined( 'ABSPATH' ) || exit; |
| 19 | |
| 20 | get_header( 'shop' ); |
| 21 | |
| 22 | /** |
| 23 | * Hook: woocommerce_before_main_content. |
| 24 | * |
| 25 | * @hooked woocommerce_output_content_wrapper - 10 (outputs opening divs for the content) |
| 26 | * @hooked woocommerce_breadcrumb - 20 |
| 27 | * @hooked WC_Structured_Data::generate_website_data() - 30 |
| 28 | */ |
| 29 | do_action( 'woocommerce_before_main_content' ); |
| 30 | |
| 31 | /** |
| 32 | * Hook: woocommerce_shop_loop_header. |
| 33 | * |
| 34 | * @since 8.6.0 |
| 35 | * |
| 36 | * @hooked woocommerce_product_taxonomy_archive_header - 10 |
| 37 | */ |
| 38 | do_action( 'woocommerce_shop_loop_header' ); |
| 39 | |
| 40 | if ( woocommerce_product_loop() ) { |
| 41 | |
| 42 | /** |
| 43 | * Hook: woocommerce_before_shop_loop. |
| 44 | * |
| 45 | * @hooked woocommerce_output_all_notices - 10 |
| 46 | * @hooked woocommerce_result_count - 20 |
| 47 | * @hooked woocommerce_catalog_ordering - 30 |
| 48 | */ |
| 49 | do_action( 'woocommerce_before_shop_loop' ); |
| 50 | |
| 51 | woocommerce_product_loop_start(); |
| 52 | |
| 53 | if ( wc_get_loop_prop( 'total' ) ) { |
| 54 | while ( have_posts() ) { |
| 55 | the_post(); |
| 56 | |
| 57 | /** |
| 58 | * Hook: woocommerce_shop_loop. |
| 59 | */ |
| 60 | do_action( 'woocommerce_shop_loop' ); |
| 61 | |
| 62 | wc_get_template_part( 'content', 'product' ); |
| 63 | } |
| 64 | } |
| 65 | |
| 66 | woocommerce_product_loop_end(); |
| 67 | |
| 68 | /** |
| 69 | * Hook: woocommerce_after_shop_loop. |
| 70 | * |
| 71 | * @hooked woocommerce_pagination - 10 |
| 72 | */ |
| 73 | do_action( 'woocommerce_after_shop_loop' ); |
| 74 | } else { |
| 75 | /** |
| 76 | * Hook: woocommerce_no_products_found. |
| 77 | * |
| 78 | * @hooked wc_no_products_found - 10 |
| 79 | */ |
| 80 | do_action( 'woocommerce_no_products_found' ); |
| 81 | } |
| 82 | |
| 83 | /** |
| 84 | * Hook: woocommerce_after_main_content. |
| 85 | * |
| 86 | * @hooked woocommerce_output_content_wrapper_end - 10 (outputs closing divs for the content) |
| 87 | */ |
| 88 | do_action( 'woocommerce_after_main_content' ); |
| 89 | |
| 90 | /** |
| 91 | * Hook: woocommerce_sidebar. |
| 92 | * |
| 93 | * @hooked woocommerce_get_sidebar - 10 |
| 94 | */ |
| 95 | do_action( 'woocommerce_sidebar' ); |
| 96 | |
| 97 | get_footer( 'shop' ); |
| 98 |