Skip to content
This repository was archived by the owner on Feb 23, 2024. It is now read-only.
This repository was archived by the owner on Feb 23, 2024. It is now read-only.

Legacy template block: themes can't override the archive-product.html only #5230

@MaggieCabrera

Description

@MaggieCabrera

Describe the bug

It seems like a theme can only override the archive product template by overriding the taxonomy category/tag templates.

To reproduce

Steps to reproduce the behavior:

  1. Install Blockbase
  2. Create a template inside block-templates/archive-product.html with this content:
<!-- wp:template-part {"slug":"header","tagName":"header"} /-->

<!-- wp:group {"tagName":"main","layout":{"inherit":true}} -->
<main class="wp-block-group">

	<!-- wp:group {"align":"wide"} -->
	<div class="wp-block-group alignwide">
		<!-- wp:woocommerce/legacy-template {"template":"archive-product"} /-->
	</div>
	<!-- /wp:group -->

</main>
<!-- /wp:group -->

<!-- wp:template-part {"slug":"footer","tagName":"footer","layout":{"inherit":true},"className":"site-footer-container"} /-->
  1. Go to the frontend and check an archive page, it's loading either taxonomy-product_cat.html or taxonomy-product_tag.html from the plugin instead of the theme template we just created (the one we created is wide aligned).

Expected behavior

I expected archive-product.html being defined in the theme to override the more specific templates from the plugin

Environment

WordPress (please complete the following information):

  • Core version: 5.8.2
  • Gutenberg version (if installed): trunk
  • WooCommerce version: 6.1.0
  • WooCommerce Blocks version: 6.5.0

Metadata

Metadata

Assignees

Labels

focus: FSEWork related to prepare WooCommerce for FSE.focus: templateRelated to API powering block template functionality in the Site Editortype: bugThe issue/PR concerns a confirmed bug.

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions