Skip to content

Conversation

@albarin
Copy link
Contributor

@albarin albarin commented Nov 17, 2022

All Submissions:

Changes proposed in this Pull Request:

The goal of this PR is to add support for the Product by attribute template. It's related to this task and this PR in woocommerce-blocks: woocommerce/woocommerce-blocks#7660.

  • This PR is a very minor change/addition and does not require testing instructions (if checked you can ignore/remove the next section).

How to test the changes in this Pull Request:

Non-FSE theme

  1. Enable the Storefront theme (or any non-FSE theme).
  2. Make sure on /wp-admin/edit.php?post_type=product&page=product_attributes that you have an attribute with the Enable archive? option checked. Otherwise, create one.
  3. On /wp-admin/edit.php?post_type=product&page=product_attributes access the attribute terms by clicking on Configure terms.
  4. If it does not have terms, create one.
  5. Click on the View option under your term to go to the frontend page of the attribute, you should see the default template loaded.
  6. Go to your theme and add a template file on the root with the name taxonomy-product_attribute.php and add some identifiable content. Save the file.
  7. Reload the page you opened on step 5. You should see the content of the new taxonomy-product_attribute.php template file you added to the theme.

FSE theme

  1. Clone and enable the trunk version of woocommerce-blocks (since the work on this PR is also needed Create the Products by Attribute template woocommerce-blocks#7660)
  2. Enable the TT2 theme (or any other FSE theme).
  3. Make sure on /wp-admin/edit.php?post_type=product&page=product_attributes that you have an attribute with the Enable archive? option checked. Otherwise, create one.
  4. On /wp-admin/edit.php?post_type=product&page=product_attributes access the attribute terms by clicking on Configure terms.
  5. If it does not have terms, create one.
  6. Click on the View option under your term to go to the frontend page of the attribute, you should see the default template loaded.
  7. Go to your theme and add a template file inside the templates folder of your theme called taxonomy-product_attribute.html and add some identifiable content. Save the file.
  8. Reload the page you opened on step 6. You should see the content of the new taxonomy-product_attribute.html template file you added to the theme.

Other information:

  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your changes, as applicable?
  • Have you created a changelog file for each project being changed, ie pnpm --filter=<project> changelog add?

FOR PR REVIEWER ONLY:

  • I have reviewed that everything is sanitized/escaped appropriately for any SQL or XSS injection possibilities. I made sure Linting is not ignored or disabled.

@github-actions github-actions bot added the plugin: woocommerce Issues related to the WooCommerce Core plugin. label Nov 17, 2022
@github-actions
Copy link
Contributor

github-actions bot commented Nov 17, 2022

Test Results Summary

Commit SHA: 674bd45

Test 🧪Passed ✅Failed 🚨Broken 🚧Skipped ⏭️Unknown ❔Total 📊Duration ⏱️
API Tests25900202611m 2s
E2E Tests186006019213m 53s

To view the full API test report, click here.
To view the full E2E test report, click here.
To view all test reports, visit the WooCommerce Test Reports Dashboard.

@albarin albarin changed the title Add support for product by attribute block template Add support for product by attribute template Nov 17, 2022
@albarin albarin force-pushed the add/7647-product-by-attribute-template branch from f969822 to 038669c Compare November 18, 2022 07:55
@albarin albarin force-pushed the add/7647-product-by-attribute-template branch from 038669c to 07e71e8 Compare November 18, 2022 08:13
@albarin albarin marked this pull request as ready for review November 18, 2022 08:20
@albarin albarin requested review from a team, Aljullu, barryhughes and gigitux and removed request for a team November 18, 2022 08:26
@albarin albarin changed the title Add support for product by attribute template Add support for 'product by attribute' template Nov 18, 2022
@albarin albarin changed the title Add support for 'product by attribute' template Add support for the Product by attribute template Nov 18, 2022
Aljullu
Aljullu previously approved these changes Nov 21, 2022
Copy link
Contributor

@Aljullu Aljullu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is working great, thanks @albarin!

I'm approving on behalf of Woo FSE, but we will need somebody from Proton to approve this PR as well.

Copy link
Member

@barryhughes barryhughes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good: couple of questions I wanted to check in on, but beyond that I think this is good to go.

Copy link
Member

@barryhughes barryhughes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

plugin: woocommerce Issues related to the WooCommerce Core plugin.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants