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
Add product pricing block #37211
Add product pricing block #37211
Conversation
Test Results SummaryCommit SHA: 5481c9a
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. |
44be8be
to
cec4187
Compare
|
||
export const initBlocks = () => { | ||
registerCoreBlocks(); |
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.
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## trunk #37211 +/- ##
==========================================
- Coverage 46.7% 46.7% -0.0%
- Complexity 17191 17192 +1
==========================================
Files 429 429
Lines 64845 64881 +36
==========================================
+ Hits 30275 30282 +7
- Misses 34570 34599 +29
|
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.
Nice work here @louwie17. I left some small comments here.
</BaseControl> | ||
{ taxSettingsElement && ( | ||
<span className="woocommerce-product-form__secondary-text"> | ||
{ taxSettingsElement } |
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.
Why you are not using the help
prop of the BaseControl
component for this case?
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.
Good point! Fixed here: dfe22e5
const context = useContext( CurrencyContext ); | ||
const { getCurrencyConfig, formatAmount } = context; | ||
const currencyConfig = getCurrencyConfig(); | ||
const inputProps = useCurrencyInputProps( { |
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.
What do you suggest if we need to extends (not overrides) the onFocus
or onKeyUp
events coming from useCurrencyInputProps
?
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.
Provided it as optional options: 5481c9a
@@ -0,0 +1,53 @@ | |||
.woocommerce-product-block-editor { |
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 need this file for my summary block implementation.
8bee742
to
5481c9a
Compare
@mdperez86 this should be good for a re-review when you have time :) |
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.
LGTM! Nice work here @louwie17. I will merge this because we need your changes for the resting blocks.
All Submissions:
Changes proposed in this Pull Request:
This creates a pricing block field that could be used for both the list price and the sale price.
Closes #37098
How to test the changes in this Pull Request:
block-editor-feature-enabled
Other information:
pnpm --filter=<project> changelog add
?FOR PR REVIEWER ONLY: