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

ALFMOB-158: Update PDP Button Copy Based on Item State #44

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

JoaoPinhoMinder
Copy link
Contributor

@JoaoPinhoMinder JoaoPinhoMinder commented Mar 13, 2025

Ticket

https://mindera.atlassian.net/browse/ALFMOB-158

Depends on: #42

Description

  • Added productsPublisher to both WishlistService and BagService to enable real-time updates of button titles based on item state.
  • Updated all relevant view models to observe productsPublisher instead of using the previous getWishlistContent and getBagContent methods.
  • Adjusted button titles dynamically to reflect the correct state ("Add to Bag" / "Remove from Bag" and "Add to Wishlist" / "Remove from Wishlist").
  • Ensured that changing color resets both buttons, while changing size only resets the "Add to Bag" button (since wishlist state is unaffected by size).
  • Added necessary localized strings to L10n table.

Evidences

Screen.Recording.2025-03-13.at.13.21.27.mov

In the **Bag** and **Wishlist** screens, tapping on a product cell now redirects the user to the **PDP** of the selected item, ensuring a smooth transition while preserving selected attributes like size and color.

**Changes & Improvements:**
- Made product cells tappable, including a tap effect for better user feedback.
- Renamed `SelectionProduct` to `SelectedProduct` for better clarity.
- Updated `SelectedProduct` to include `Product` and `Product.Variant` properties.
- Implemented a mechanism to open **PDP** with a `SelectedProduct`.
- Fixed an issue in `buildColorAndSizingSelectionConfigurations` where the `Product.Variant` parameter was not being properly used.
- Created `WishlistProduct` and `BagProduct` inheriting from `SelectedProduct`.
- Made `WishlistProduct` unique by **product ID and color ID**.
- Made `BagProduct` unique by **product ID and variant SKU**.
- Removed size information from `WishlistView` and `ProductListingView`.
- Updated **"Add to Bag"** action in `WishlistView` to redirect users to **PDP** for size selection instead of adding directly to the bag.
- Disabled **"Add to Bag"** button on **PDP** until both **color** (pre-selected) and **size** have been selected.
- Added `productsPublisher` to both `WishlistService` and `BagService` to enable real-time updates of button titles based on item state.
- Updated all relevant view models to observe `productsPublisher` instead of using the previous `getWishlistContent` and `getBagContent` methods.
- Adjusted button titles dynamically to reflect the correct state (`"Add to Bag"` / `"Remove from Bag"` and `"Add to Wishlist"` / `"Remove from Wishlist"`).
- Ensured that changing color resets both buttons, while changing size only resets the `"Add to Bag"` button (since wishlist state is unaffected by size).
- Added necessary localized strings to `L10n` table.
@JoaoPinhoMinder JoaoPinhoMinder force-pushed the task/ALFMOB-158-update-pdp-button-copy-based-on-item-state branch from f5d495f to 6b6da16 Compare March 13, 2025 14:38
@JoaoPinhoMinder JoaoPinhoMinder marked this pull request as ready for review March 13, 2025 14:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant