This repository has been archived by the owner on Feb 23, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 219
Fix Product SKU not being displayed on frontend #9446
Merged
thealexandrelara
merged 1 commit into
trunk
from
fix/9030-product-sku-not-being-displayed-on-frontend
May 16, 2023
Merged
Fix Product SKU not being displayed on frontend #9446
thealexandrelara
merged 1 commit into
trunk
from
fix/9030-product-sku-not-being-displayed-on-frontend
May 16, 2023
Conversation
This file contains 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
β¦roduct template
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
assets/js/atomic/blocks/product-elements/shared/use-is-descendent-of-single-product-block.tsx
|
Size Change: +94 B (0%) Total Size: 1.11 MB
βΉοΈ View Unchanged
|
thealexandrelara
added
type: bug
The issue/PR concerns a confirmed bug.
block-type: product
Issues related to/affecting all blocks related to products.
labels
May 11, 2023
14 tasks
nefeline
reviewed
May 12, 2023
blockClientId: string; | ||
} | ||
|
||
export const useIsDescendentOfSingleProductBlock = ( { |
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.
π glad to see this as a hook now!
nefeline
approved these changes
May 16, 2023
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.
Great work!
β Confirmed that the SKU is adequately displayed on the FE and in the editor.
thealexandrelara
deleted the
fix/9030-product-sku-not-being-displayed-on-frontend
branch
May 16, 2023 18:25
thealexandrelara
added
the
skip-changelog
PRs that you don't want to appear in the changelog.
label
May 17, 2023
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
block-type: product
Issues related to/affecting all blocks related to products.
skip-changelog
PRs that you don't want to appear in the changelog.
type: bug
The issue/PR concerns a confirmed bug.
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.
Description
π€ Generated by Copilot at bd5da9a
π¨βπ» Enhanced by @thealexandrelara
This pull request adds a custom hook
useIsDescendentOfSingleProductBlock
and uses it in the SKU block to make it compatible with both global and single product contexts. This allows the SKU block to display the correct product data and format depending on where it is inserted.Walkthrough
π€ Generated by Copilot at bd5da9a
π¨βπ» Enhanced by @thealexandrelara
useIsDescendentOfSingleProductBlock
that returns a boolean indicating whether a given block is a descendent of a single product block (link)isDescendentOfSingleProductBlock
for the current block (link, link)useProductDataContext
hook and theProductSKU
component as a prop (link, link, link)useProductDataContext
hook and theProductSKU
component respectively (link, link)types.ts
(link)Fixes #9030
Accessibility
prefers-reduced-motion
Other Checks
Screenshots
Testing
Automated Tests
User Facing Testing
WooCommerce Visibility