-
Notifications
You must be signed in to change notification settings - Fork 21
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 free shipping order value condition for shipping phase 1 #2686
Add free shipping order value condition for shipping phase 1 #2686
Conversation
Because we've moved minimum order card from folder js/src/components/shipping-rate-section to js/src/components/order-value-condition-section Previously the mock was added in js/src/components/shipping-rate-section/shipping-rate-section.test.js
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## update/shippings-settings-phase-1 #2686 +/- ##
===================================================================
- Coverage 63.9% 63.6% -0.3%
===================================================================
Files 324 326 +2
Lines 5140 5191 +51
Branches 1255 1261 +6
===================================================================
+ Hits 3286 3302 +16
- Misses 1680 1715 +35
Partials 174 174
Flags with carried forward coverage won't be shown. Click here to find out more.
|
One issue I see is that the Save button doesn't work until you toggle "Free shipping over a specific order" Screen.Recording.2024-11-28.at.12.22.31.mov |
Previously it was implemented using radios so offer_free_shipping has an undefined value. The validation makes sense back then. But right now it is implemented using a checkbox, there should not be an undefined value.
Thanks for catching it! Fixed in 5efbc56. It's because previously it was implemented using radio buttons so offer_free_shipping has an undefined value. The validation makes sense back then. But right now it is implemented using a checkbox, there should not be an undefined value, and the validation is not required now. |
@@ -46,32 +48,40 @@ const MinimumOrderInputControl = ( props ) => { | |||
} ); | |||
}; | |||
|
|||
const shouldHideInput = ! values.offer_free_shipping; |
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.
💅 Not a big deal for me. But maybe doing if ( shouldHideInput ) { return null; }
we can avoid the styling and
{ ! shouldHideInput && currency && (
<>{ `Cost (${ currency })` }</>
) }
chunk. I believe the currency is always available?
Not sure how much a blocker is this. I see that when we toggle the checkout. The value inside the minimum order value condition field disappears. This also happens in the previous implementation. So I'm approving the PR Screen.Recording.2024-11-29.at.12.44.47.mov |
Changes proposed in this Pull Request:
Part of pcTzPl-2qP-p2, this PR implements the last design of the new shipping phase 1 for setting the free shipping order value.
The PR follows this design with slightly changes based on the discussion in pcTzPl-2qP-p2#comment-3723 and pcTzPl-2qP-p2#comment-3731.
Notable changes in this PR:
js/src/components/order-value-condition-section
MinumumOrderCard
fromjs/src/components/shipping-rate-section
to the new folderjs/src/components/order-value-condition-section
, since the card can be reused with slightly changes.Screenshots:
shipping-phase-1-order-value-condition-2.mp4
Detailed test instructions:
Additional details:
Changelog entry