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
Ensure shipping rate names show when multiple packages are used #6753
Merged
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
opr
added
status: needs review
type: bug
The issue/PR concerns a confirmed bug.
focus: blocks
Specific work involving or impacting how blocks behave.
block: checkout
Issues related to the checkout block.
labels
Jul 25, 2022
rubikuserbot
requested review from
a team and
wavvves
and removed request for
a team
July 25, 2022 16:16
The release ZIP for this PR is accessible via:
|
Size Change: +4.11 kB (0%) Total Size: 877 kB
ℹ️ View Unchanged
|
wavvves
approved these changes
Jul 26, 2022
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.
github-actions
bot
added
status: ready to merge
and removed
status: needs review
labels
Jul 26, 2022
Closed
7 tasks
senadir
reviewed
Aug 14, 2022
@@ -65,7 +65,9 @@ const Packages = ( { | |||
packageData={ packageData } | |||
collapsible={ collapsible } | |||
collapse={ collapse } | |||
showItems={ showItems } | |||
showItems={ | |||
showItems || packageData?.shipping_rates?.length > 1 |
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.
This logic will evaluate to true when you have multiple shipping rates within a single package, not overall.
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.
Logic should be showItems || packages.length > 1
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
block: checkout
Issues related to the checkout block.
focus: blocks
Specific work involving or impacting how blocks behave.
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.
This PR will ensure shipping rate names show when multiple shipping packages are in the cart. It will also fix an issue in the editor where shipping rates don't show.
To fix shipping rates not showing in the editor: in the
useShippingData
hook, we now check if we're in the editor, and if so show the values frompreviewShippingRates
, or else we get it from thewc/store/cart
data store.To fix the issue of names not showing, I checked the value of
packageData?.shipping_rates?.length
inShippingRatesControl
. This is then used in the condition that determines whether to show the name or notwoocommerce-blocks/assets/js/base/components/cart-checkout/shipping-rates-control-package/index.tsx
Lines 72 to 76 in 5545c38
it defaulted to false.
Fixes #6437
Screenshots
👆🏻 note the spacing is fixed in #6740 👆🏻
Testing
Automated Tests
User Facing Testing
WooCommerce Visibility
Performance Impact
Changelog