Overriding WooCommerce archive-product.php
Recently I was working on a WooCommerce project and was having problems customizing the Products Page, I can’t seem to override the archive-product.php. Later I found out that the problem is due to the function woocommerce_content() outputting the wrong page for archive content.
To get around it, replace
1 | <?php woocommerce_content() ?> |
in woocommerce.php with:
1 2 3 4 5 | <?php if ( is_singular( 'product' ) ): ?> <?php woocommerce_content(); ?> <?php else: ?> <?php woocommerce_get_template( 'archive-product.php' ); ?> <?php endif; ?> |
Do you need help with a project? or have a new project in mind that you need help with?
Contact Me