1 min read

Wishlist Item View

Last Updated - Platform 19.0.0 - SDK 14.0.0

The WishlistItemView is essentially the WishlistItemViewCell presented by the WishlistViewDataSource. However, they have been separated to make it easy to modify the view using Containers rather than subclass the data source and cell.

Container.shared.views.wishlistItemView = {
PoqWishlistItemView()
}

The PoqWishlistItemView (default) variation of this view:

  • Uses WishlistItemViewData.
  • Presents the product image, title (and optionally variant information).
  • Supports Skeletonable to present a nice loading state.
  • Reads as a single button using Voice Over with actions available for removing from the Wishlist.

Wishlist View
Wishlist View

View Data Mapper

The WishlistItemViewDataMapper is the mapper used to map from PlatformProduct (currently an outdated domain object) to the WishlistItemViewData to present.

Container.shared.mappers.wishlistItemViewDataMapper = {
PoqWishlistItemViewDataMapper()
}

Data Mapper

At the data layer, the WishlistItemDataMapper handles mapping from WishlistItemProductData to PlatformProduct. We have provided two concretions of this mapper to work for a listing (default) and variant Wishlists.

The PoqWishlistItemListingDataMapper (default) variation of this mapper:

  • Maps listing level products from ProductData and essentially adds products without having selected forms to the Wishlist.
  • Can be used for clients that have wishlisting from the Product List.
  • Can toggle mapping of out of stock sizes. By default, we ignore out of stock sizes because the platform size selector cannot handle them.
Container.shared.mappers.wishlistItemDataMapper = {
PoqWishlistItemListingDataMapper(
allowsOutOfStockSizes: false
)
}

The PoqWishlistItemVariantDataMapper variation of this mapper:

  • Maps variant level products from ProductData and therefor adds SKUs to the Wishlist.
  • Can be used for clients that cannot wishlist from the Product List and use inline form selectors in the Product Details.
  • Can toggle mapping of out of stock sizes. By default, we ignore out of stock sizes because the platform size selector cannot handle them.
Container.shared.mappers.wishlistItemDataMapper = {
PoqWishlistItemVariantDataMapper(
allowsOutOfStockSizes: false
)
}