Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integration with WooCommerce Product Category Archives #234

Open
craigwilcox opened this issue Sep 6, 2022 · 0 comments
Open

Integration with WooCommerce Product Category Archives #234

craigwilcox opened this issue Sep 6, 2022 · 0 comments

Comments

@craigwilcox
Copy link

At the moment, WP Gatsby incremental builds do not support WooCommerce Product Category archive changes. As with Issue #233 (#233), supporting these updates would be helpful to avoid clearing caches and rebuilding to update content.

When a product category is added or updated, an Action Monitor should detect the changes, clear the relevant caches, and rebuild archive pages. It should also detect changes to ACF fields used by category pages, as those are a helpful way to expand the functionality of the archive pages.

If there are hooks that are fired from the use of mutations on wpProductCategories, which should be more rare than single products, those should trigger the Monitor, as well.

Here is an example query our team uses to build product category archive pages:

{
    wpProductCategory(id: { eq: $productCategoryId }) {
      slug
      name
      description
      uri
    }
    allWpProductCategory(
      limit: $perPage
      skip: $offset
      filter: {
        wpParent: { node: { id: { eq: $productCategoryId } } }
      }
      sort: { fields: menuOrder, order: ASC }
    ) {
      nodes {
        name
        slug
        uri
        image {
          sourceUrl
          srcSet
          altText
          localFile {
            extension
            publicURL
            childImageSharp {
              gatsbyImageData
            }
          }
        }
        id
        slug
        termTaxonomyId: databaseId
        seo {
          metaDesc
          opengraphImage {
            sourceUrl
          }
        }
        wpChildren {
          nodes {
            id
            name
            uri
          }
        }
      }
    }
  }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant