auth
2 years ago
cart
2 years ago
checkout
2 years ago
emails
2 years ago
global
2 years ago
loop
2 years ago
myaccount
2 years ago
notices
2 years ago
order
2 years ago
single-product
2 years ago
archive-product.php
2 years ago
content-product-cat.php
2 years ago
content-product.php
2 years 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
2 years 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
106 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://woo.com/document/template-structure/ |
| 14 | * @package WooCommerce\Templates |
| 15 | * @version 3.4.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 | <header class="woocommerce-products-header"> |
| 33 | <?php if ( apply_filters( 'woocommerce_show_page_title', true ) ) : ?> |
| 34 | <h1 class="woocommerce-products-header__title page-title"><?php woocommerce_page_title(); ?></h1> |
| 35 | <?php endif; ?> |
| 36 | |
| 37 | <?php |
| 38 | /** |
| 39 | * Hook: woocommerce_archive_description. |
| 40 | * |
| 41 | * @hooked woocommerce_taxonomy_archive_description - 10 |
| 42 | * @hooked woocommerce_product_archive_description - 10 |
| 43 | */ |
| 44 | do_action( 'woocommerce_archive_description' ); |
| 45 | ?> |
| 46 | </header> |
| 47 | <?php |
| 48 | if ( woocommerce_product_loop() ) { |
| 49 | |
| 50 | /** |
| 51 | * Hook: woocommerce_before_shop_loop. |
| 52 | * |
| 53 | * @hooked woocommerce_output_all_notices - 10 |
| 54 | * @hooked woocommerce_result_count - 20 |
| 55 | * @hooked woocommerce_catalog_ordering - 30 |
| 56 | */ |
| 57 | do_action( 'woocommerce_before_shop_loop' ); |
| 58 | |
| 59 | woocommerce_product_loop_start(); |
| 60 | |
| 61 | if ( wc_get_loop_prop( 'total' ) ) { |
| 62 | while ( have_posts() ) { |
| 63 | the_post(); |
| 64 | |
| 65 | /** |
| 66 | * Hook: woocommerce_shop_loop. |
| 67 | */ |
| 68 | do_action( 'woocommerce_shop_loop' ); |
| 69 | |
| 70 | wc_get_template_part( 'content', 'product' ); |
| 71 | } |
| 72 | } |
| 73 | |
| 74 | woocommerce_product_loop_end(); |
| 75 | |
| 76 | /** |
| 77 | * Hook: woocommerce_after_shop_loop. |
| 78 | * |
| 79 | * @hooked woocommerce_pagination - 10 |
| 80 | */ |
| 81 | do_action( 'woocommerce_after_shop_loop' ); |
| 82 | } else { |
| 83 | /** |
| 84 | * Hook: woocommerce_no_products_found. |
| 85 | * |
| 86 | * @hooked wc_no_products_found - 10 |
| 87 | */ |
| 88 | do_action( 'woocommerce_no_products_found' ); |
| 89 | } |
| 90 | |
| 91 | /** |
| 92 | * Hook: woocommerce_after_main_content. |
| 93 | * |
| 94 | * @hooked woocommerce_output_content_wrapper_end - 10 (outputs closing divs for the content) |
| 95 | */ |
| 96 | do_action( 'woocommerce_after_main_content' ); |
| 97 | |
| 98 | /** |
| 99 | * Hook: woocommerce_sidebar. |
| 100 | * |
| 101 | * @hooked woocommerce_get_sidebar - 10 |
| 102 | */ |
| 103 | do_action( 'woocommerce_sidebar' ); |
| 104 | |
| 105 | get_footer( 'shop' ); |
| 106 |