Skip to content

Commit

Permalink
fix add t cart
Browse files Browse the repository at this point in the history
  • Loading branch information
nqmgaming committed Jun 9, 2024
1 parent 985b05b commit 6fd2f38
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class OrderItemAdapter(
binding.tvCategoryItemOrder.text = product.category.name
val formattedPrice =
NumberFormat.getNumberInstance(Locale.US).format(product.price.toInt())
binding.tvPriceItemOrder.text = "Price: ${formattedPrice}"
binding.tvPriceItemOrder.text = "Price: ${formattedPrice} $"

}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class OrderTotalAdapter(
binding.tvDay.text = formattedDate
val formattedPrice =
NumberFormat.getNumberInstance(Locale.US).format(order.total.toInt())
binding.tvTotalPrice.text = formattedPrice
binding.tvTotalPrice.text = formattedPrice + " $"
binding.itemOrderRecyclerView.setHasFixedSize(true)
binding.itemOrderRecyclerView.adapter = OrderItemAdapter(
viewModel,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,10 @@ class ProductDetailActivity : AppCompatActivity() {
price = it.price
productImage = it.imagePreview
categoryId = it.category.id
if (it.stock <= 0) {
binding.addToBagBtn.isEnabled = false
binding.addToBagBtn.text = "Out of stock"
}
}
viewModel.getProductsByCategory(token, categoryId) {
if (it != null) {
Expand Down
1 change: 0 additions & 1 deletion app/src/main/res/layout/fragment_profile.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginVertical="20dp"
android:text="Name"
android:textColor="@color/colorBlack"
android:textSize="18sp"
android:textStyle="bold"
Expand Down

0 comments on commit 6fd2f38

Please sign in to comment.