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.

Can't save modified WC block template if theme doesn't include it #5024

@Aljullu

Description

@Aljullu

If the user modifies a WooCommerce block template but the theme doesn't include it, it will fail to save.

To reproduce

  1. Amend WooCommerce Core or checkout this PR Update has_block_template function to use apply_filters woocommerce#30997
  2. Add the following snippet in the directory specified:

/woo-blocks/templates/block-templates/single-product.html

<!-- wp:template-part {"slug":"header","tagName":"header","className":"site-header","layout":{"inherit":true} /-->
<!-- wp:paragraph --> <p>You are using the Woo Blocks block template now</p> <!-- /wp:paragraph -->
<!-- wp:template-part {"slug":"footer","tagName":"footer","className":"site-footer","layout":{"inherit":true} /-->
  1. Go to Site Editor > Templates and modify the Single product template.
  2. Try to save the template. If you take a look at the Network tab of your devtools, you will notice the request returned error 404. If you reload the page, you will notice the changes weren't saved.

Metadata

Metadata

Assignees

Labels

focus: FSEWork related to prepare WooCommerce for FSE.type: bugThe issue/PR concerns a confirmed bug.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions