This repository was archived by the owner on Feb 23, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 215
Blockified Single Product Template: add product-classes via wc_get_product_class
#9697
Merged
gigitux
merged 3 commits into
trunk
from
9686-blockified-single-product-template-inject-the-product-specific-classes-like-woocommerce-core
Jun 2, 2023
Merged
Blockified Single Product Template: add product-classes via wc_get_product_class
#9697
gigitux
merged 3 commits into
trunk
from
9686-blockified-single-product-template-inject-the-product-specific-classes-like-woocommerce-core
Jun 2, 2023
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 tasks
Contributor
|
The release ZIP for this PR is accessible via: Script Dependencies ReportThere is no changed script dependency between this branch and trunk. This comment was automatically generated by the TypeScript Errors Report
🎉 🎉 This PR does not introduce new TS errors. |
Contributor
|
Size Change: 0 B Total Size: 1.1 MB ℹ️ View Unchanged
|
kmanijak
approved these changes
Jun 2, 2023
Contributor
kmanijak
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I confirm that a set of classes (example: status-publish instock product_cat-accessories has-post-thumbnail sale shipping-taxable purchasable product-type-simple) are added to the body when using blockified Single Product template.
I'm leaving a minor comment but approving!
Thanks for a nice showcase of writing E2E test with Playwright! 💪
Co-authored-by: Karol Manijak <[email protected]>
…ocks into 9686-blockified-single-product-template-inject-the-product-specific-classes-like-woocommerce-core
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
focus: template
Related to API powering block template functionality in the Site Editor
type: enhancement
The issue is a request for an enhancement.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
@xristos3490 noticed that we don't load product classes on the Blockified Single Product Template. This PR fixes this. Instead of injecting on the main div wrapper as WooCommerce Core does, we inject the classes on the body.
I noticed that the classes
firstandlastare added and this is odd in the case of the Single Product Template. The reason is that we invoke the functionwc_get_product_classnot in the appropriate place. We should refactor this when we will work on the refactor of theBlockTemplatesController. #9491Fixes #9686
Testing
Automated Tests
User Facing Testing
WooCommerce Visibility
Changelog