-
Notifications
You must be signed in to change notification settings - Fork 136
Product details: Do not show "one time shipping" label on Simple Product #13032
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
Product details: Do not show "one time shipping" label on Simple Product #13032
Conversation
…bscription product.
… and simple product details.
📲 You can test the changes from this Pull Request in WooCommerce-Wear Android by scanning the QR code below to install the corresponding build.
|
|
📲 You can test the changes from this Pull Request in WooCommerce Android by scanning the QR code below to install the corresponding build.
|
… should not show "One time shipping" label.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## trunk #13032 +/- ##
============================================
+ Coverage 40.13% 40.23% +0.10%
- Complexity 6120 6138 +18
============================================
Files 1280 1280
Lines 74008 74011 +3
Branches 10122 10124 +2
============================================
+ Hits 29703 29779 +76
+ Misses 41725 41645 -80
- Partials 2580 2587 +7 ☔ View full report in Codecov by Sentry. |
JorgeMucientes
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.
Nice job @hafizrahman it works as expected and code looks good. Thanks for adding the unit tests.
Btw I was about to report the weird issue about the shipping card being gone when switching the product from subscription to simple when I noticed you already created a GH issue for it. Anyway I think it is a very minor thing and very corner case for a user to land in that situation, so I wouldn't spend to much time fixing it, unless it is very straighforward :)
| // Only add "One time shipping" info if product is Subscription types | ||
| if (currentProduct.productType == SUBSCRIPTION || currentProduct.productType == VARIABLE_SUBSCRIPTION) { |
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 catch adding this check!
Yeah! I ended up working on it here #13035 |
Closes: #13027
Description
When a subscription product that has "One time shipping" enabled get converted into simple product, "One time shipping" label is still shown. This is incorrect because "one time shipping" is only supported in subscription product, not simple.
This PR adds the fix by checking product type and not showing the label if it's simple.
That issue is not tackled here yet.
Steps to reproduce
Testing information
Tested in API 35 with Simulator.
I also discovered a separate issue when working on this:
Given product details with "one time shipping" enabled but no other shipping values entered, when switching to simple product, Shipping card disappears
This issue is not tackled in this PR.
The tests that have been performed
The listed steps above.
Images/gif
Screen_recording_20241129_163549.mp4
RELEASE-NOTES.txtif necessary. Use the "[Internal]" label for non-user-facing changes.Reviewer (or Author, in the case of optional code reviews):
Please make sure these conditions are met before approving the PR, or request changes if the PR needs improvement: