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

Store Editing Templates: Product Category doesn't load Product Archive as a fallback edgecase. #5799

Closed
tjcafferkey opened this issue Feb 9, 2022 · 3 comments
Labels
focus: FSE Work related to prepare WooCommerce for FSE. focus: template Related to API powering block template functionality in the Site Editor status: stale Stale issues and PRs have had no updates for 60 days. type: bug The issue/PR concerns a confirmed bug.

Comments

@tjcafferkey
Copy link
Contributor

tjcafferkey commented Feb 9, 2022

Describe the bug

There is a specific scenario where the Product Category does not load the Product Archive template as a fallback when it is eligible to do so.

To reproduce

Steps to reproduce the behavior:

  1. Ensure you're running latest WooCommerce & WordPress 5.9 with TwentyTwentyTwo theme activated.
  2. Make sure your block theme has a archive-product.html file, this will be used as the fallback template for Product Category/Tag templates.
  3. In Settings > Reading set your Homepage to be the "Shop" page.
  4. Start outside the site Editor in WP Admin (Appearance > Themes).
  5. Now navigate to Appearance > Site Editor. Because your "Shop" is set as the homepage it should load the archive-product template here initially.
  6. Now browse to "All Templates" to view the complete list of templates.
  7. Scroll down to "Product Category" and notice how it correctly indicates it is from the theme.
  8. Click into it to edit the template and notice how the template is empty.

Some things to note:

  • If you refresh the page the template gets loaded correctly.
  • If you navigate back out of the empty template, into different template and then back into the Product Category template it loads correctly.
  • If you don't set "Shop" as your homepage this bug doesn't appear.
  • The correct template data is present in the core redux store, even when displaying a blank template.
  • If you have Gutenberg activated, when presented with the blank template if you switch between the Code Editor and Visual Editor (triggering a rerender) the template renders correctly.

This could be an issue within Gutenbergs Site Editor.

Expected behavior

  • On step 8 the template should load correctly.

Screenshots

blank-category-bug.mp4
@tjcafferkey tjcafferkey added type: bug The issue/PR concerns a confirmed bug. focus: FSE Work related to prepare WooCommerce for FSE. focus: template Related to API powering block template functionality in the Site Editor labels Feb 9, 2022
@tjcafferkey tjcafferkey self-assigned this Feb 9, 2022
@tjcafferkey tjcafferkey removed their assignment Feb 9, 2022
@github-actions
Copy link
Contributor

This issue has been marked as stale because it has not seen any activity within the past 60 days. Our team uses this tool to help surface issues for review. If you are the author of the issue there's no need to comment as it will be looked at.

Internal: After 10 days with no activity this issue will be automatically be closed.

@github-actions github-actions bot added the status: stale Stale issues and PRs have had no updates for 60 days. label Apr 11, 2022
@tjcafferkey tjcafferkey reopened this Apr 22, 2022
@github-actions github-actions bot closed this as completed May 3, 2022
@tjcafferkey tjcafferkey reopened this May 3, 2022
@tjcafferkey tjcafferkey removed the status: stale Stale issues and PRs have had no updates for 60 days. label May 3, 2022
@github-actions
Copy link
Contributor

github-actions bot commented Jul 3, 2022

This issue has been marked as stale because it has not seen any activity within the past 60 days. Our team uses this tool to help surface issues for review. If you are the author of the issue there's no need to comment as it will be looked at.

Internal: After 10 days with no activity this issue will be automatically be closed.

@github-actions github-actions bot added the status: stale Stale issues and PRs have had no updates for 60 days. label Jul 3, 2022
@Aljullu
Copy link
Contributor

Aljullu commented Aug 16, 2022

@tjcafferkey do you think this issue is the same as woocommerce/woocommerce#42656? Otherwise, should we reopen?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
focus: FSE Work related to prepare WooCommerce for FSE. focus: template Related to API powering block template functionality in the Site Editor status: stale Stale issues and PRs have had no updates for 60 days. type: bug The issue/PR concerns a confirmed bug.
Projects
None yet
Development

No branches or pull requests

2 participants