bobbingwide / vgc

VGC - Garden Vista Group theme
GNU General Public License v2.0
0 stars 0 forks source link

`sidebar-shop` template part being included twice on `archive-product.php` #53

Closed bobbingwide closed 1 year ago

bobbingwide commented 1 year ago

I was using Query Monitor to see what template parts were being loaded for the store and product archives pages and noticed that on the store home page the sidebar-shop template part was shown as being included twice.

After much debug tracing I confirmed it wasn't a bug in Query Monitor and that it was a minor bug in the theme.

In archive-product.php the sidebar is included using get_sidebar('shop'). Then it's requested again by the magic of WooCommerce when do_action( 'woocommerce_sidebar') is run at the end of the template.

This second invocation doesn't occur in taxonomy-product-cat-.php since the do_action call is commented out.

Note: On the store page we don't see the sidebar being loaded more than once since the default processing when loading a sidebar is to call load_template() with $load_once=true, causing it to use require_once.

Proposed fix

bobbingwide commented 1 year ago

Delivered in v1.5.1