-
Notifications
You must be signed in to change notification settings - Fork 5
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
Allow selecting different variant options, respect available for sale #181
base: main
Are you sure you want to change the base?
Conversation
@@ -95,6 +96,7 @@ fun CartItem( | |||
style = MaterialTheme.typography.bodySmall, | |||
color = MaterialTheme.colorScheme.secondary, | |||
) | |||
BodySmall(cartLine.variantDescription) |
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.
display selected options on the cart page
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.
What happens with products without variantDescription
?
edit:
nvm, it's a non-nullable attribute
MoneyText( | ||
currency = product.priceRange.maxVariantPrice.currencyCode, | ||
price = product.priceRange.maxVariantPrice.amount, | ||
MoneyRangeText( |
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 should be a range for products with differently priced variants
} | ||
|
||
QuantitySelector(enabled = true, quantity = productUIState.addQuantityAmount) { quantity -> | ||
productViewModel.setAddQuantityAmount(quantity) | ||
} | ||
|
||
AddToCartButton( | ||
enabled = productUIState.selectedVariant.availableForSale, |
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.
disable add to cart if the selected variant is not available for sale
@@ -52,14 +52,14 @@ class ProductRepository( | |||
if (products == null) { | |||
continuation.resumeWith(Result.failure(RuntimeException("Failed to fetch products"))) | |||
} else { | |||
val products = Products( | |||
val result = Products( |
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.
small fix for the var name products
being shadowed
What changes are you making?
Allow selecting different variant options, respect available for sale
How to test
I've added variants to the cat palm product in the checkout store for testing
variants.mp4
Before you merge
Important
Checklist for releasing a new version
build.gradle
fileTip
See the Contributing documentation for instructions on how to publish a new version of the library.