Skip to content
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

[Woo POS][Non-Simple Products] Update Variation Name Display Logic #13332

Open
wants to merge 6 commits into
base: trunk
Choose a base branch
from

Conversation

AnirudhBhat
Copy link
Contributor

Closes: #13330

Description

This PR updates the logic for displaying the name of variable products. Previously, only the attribute value (e.g., Red) was shown. With this change, both the attribute name and value (e.g., Color:Red) will be displayed for better clarity and user understanding.

Changes

  1. Added new getNameForPOS function to include both attribute name and attribute value in the format {name}:{value}.
  2. Modified the separator from - to , for a cleaner and more intuitive representation of attributes.
  3. Display Parent product name in cart when variation is added to cart.

Steps to reproduce

  1. Navigate to POS (more menu -> POS)
  2. Click on any variable product
  3. Ensure you see variation name in the format {attribute name}:{attribute value}
  4. Add variation to cart
  5. Ensure you see parent product name, attributes, and price of variation in cart

The tests that have been performed

Tested above mentioned steps in both light and dark mode

Images/gif

variation_fill_name

  • I have considered if this change warrants release notes and have added them to RELEASE-NOTES.txt if 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:

  • The PR is small and has a clear, single focus, or a valid explanation is provided in the description. If needed, please request to split it into smaller PRs.
  • Ensure Adequate Unit Test Coverage: The changes are reasonably covered by unit tests or an explanation is provided in the PR description.
  • Manual Testing: The author listed all the tests they ran, including smoke tests when needed (e.g., for refactorings). The reviewer confirmed that the PR works as expected on big (tablet) and small (phone) in case of UI changes, and no regressions are added.

@AnirudhBhat AnirudhBhat added type: task An internally driven task. feature: point of sale POS project labels Jan 16, 2025
@AnirudhBhat AnirudhBhat added this to the 21.5 milestone Jan 16, 2025
@wpmobilebot
Copy link
Collaborator

wpmobilebot commented Jan 16, 2025

📲 You can test the changes from this Pull Request in WooCommerce-Wear Android by scanning the QR code below to install the corresponding build.
App Name WooCommerce-Wear Android
Platform⌚️ Wear OS
FlavorJalapeno
Build TypeDebug
Commita0461ca
Direct Downloadwoocommerce-wear-prototype-build-pr13332-a0461ca.apk

@wpmobilebot
Copy link
Collaborator

wpmobilebot commented Jan 16, 2025

📲 You can test the changes from this Pull Request in WooCommerce Android by scanning the QR code below to install the corresponding build.

App Name WooCommerce Android
Platform📱 Mobile
FlavorJalapeno
Build TypeDebug
Commita0461ca
Direct Downloadwoocommerce-prototype-build-pr13332-a0461ca.apk

@codecov-commenter
Copy link

Codecov Report

Attention: Patch coverage is 46.15385% with 7 lines in your changes missing coverage. Please review.

Project coverage is 41.09%. Comparing base (a938c73) to head (a0461ca).
Report is 21 commits behind head on trunk.

Files with missing lines Patch % Lines
.../com/woocommerce/android/model/ProductVariation.kt 20.00% 2 Missing and 2 partials ⚠️
...home/items/variations/WooPosVariationsViewModel.kt 33.33% 1 Missing and 1 partial ⚠️
...id/ui/woopos/home/totals/WooPosTotalsRepository.kt 0.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##              trunk   #13332      +/-   ##
============================================
- Coverage     41.09%   41.09%   -0.01%     
- Complexity     6420     6421       +1     
============================================
  Files          1321     1321              
  Lines         77200    77208       +8     
  Branches      10651    10652       +1     
============================================
+ Hits          31727    31730       +3     
- Misses        42663    42667       +4     
- Partials       2810     2811       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature: point of sale POS project type: task An internally driven task.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Woo POS][Non-Simple Products] For variable product, use attribute name as well as value
3 participants