Code Duplication    Length = 23-54 lines in 2 locations

includes/wc-template-functions.php 1 location

@@ 406-428 (lines=23) @@
403
404
			<?php do_action( 'woocommerce_archive_description' ); ?>
405
406
			<?php if ( have_posts() ) : ?>
407
408
				<?php do_action('woocommerce_before_shop_loop'); ?>
409
410
				<?php woocommerce_product_loop_start(); ?>
411
412
					<?php woocommerce_product_subcategories(); ?>
413
414
					<?php while ( have_posts() ) : the_post(); ?>
415
416
						<?php wc_get_template_part( 'content', 'product' ); ?>
417
418
					<?php endwhile; // end of the loop. ?>
419
420
				<?php woocommerce_product_loop_end(); ?>
421
422
				<?php do_action('woocommerce_after_shop_loop'); ?>
423
424
			<?php elseif ( ! woocommerce_product_subcategories( array( 'before' => woocommerce_product_loop_start( false ), 'after' => woocommerce_product_loop_end( false ) ) ) ) : ?>
425
426
				<?php do_action( 'woocommerce_no_products_found' ); ?>
427
428
			<?php endif;
429
430
		}
431
	}

templates/archive-product.php 1 location

@@ 56-109 (lines=54) @@
53
54
    </header>
55
56
		<?php if ( have_posts() ) : ?>
57
58
			<?php
59
				/**
60
				 * woocommerce_before_shop_loop hook.
61
				 *
62
				 * @hooked woocommerce_result_count - 20
63
				 * @hooked woocommerce_catalog_ordering - 30
64
				 */
65
				do_action( 'woocommerce_before_shop_loop' );
66
			?>
67
68
			<?php woocommerce_product_loop_start(); ?>
69
70
				<?php woocommerce_product_subcategories(); ?>
71
72
				<?php while ( have_posts() ) : the_post(); ?>
73
74
					<?php
75
						/**
76
						 * woocommerce_shop_loop_hook.
77
						 *
78
						 * @hooked WC_Structured_Data::generate_product_data() - 10
79
						 */
80
						do_action( 'woocommerce_shop_loop' );
81
					?>
82
83
					<?php wc_get_template_part( 'content', 'product' ); ?>
84
85
				<?php endwhile; // end of the loop. ?>
86
87
			<?php woocommerce_product_loop_end(); ?>
88
89
			<?php
90
				/**
91
				 * woocommerce_after_shop_loop hook.
92
				 *
93
				 * @hooked woocommerce_pagination - 10
94
				 */
95
				do_action( 'woocommerce_after_shop_loop' );
96
			?>
97
98
		<?php elseif ( ! woocommerce_product_subcategories( array( 'before' => woocommerce_product_loop_start( false ), 'after' => woocommerce_product_loop_end( false ) ) ) ) : ?>
99
100
			<?php
101
				/**
102
				 * woocommerce_no_products_found hook.
103
				 *
104
				 * @hooked wc_no_products_found - 10
105
				 */
106
				do_action( 'woocommerce_no_products_found' );
107
			?>
108
109
		<?php endif; ?>
110
111
	<?php
112
		/**