This commit is contained in:
Phuoc Nguyen
2025-12-09 16:57:58 +07:00
parent 597c6a0e57
commit 4cfe000172
11 changed files with 89 additions and 2 deletions

View File

@@ -29,6 +29,8 @@ import 'package:worker/features/cart/presentation/widgets/payment_method_section
import 'package:worker/features/cart/presentation/widgets/price_negotiation_section.dart';
import 'package:worker/features/orders/presentation/providers/order_status_provider.dart';
import 'package:worker/features/orders/presentation/providers/payment_terms_provider.dart';
import 'package:worker/core/services/analytics_service.dart';
import 'package:firebase_analytics/firebase_analytics.dart';
/// Checkout Page
///
@@ -104,6 +106,22 @@ class CheckoutPage extends HookConsumerWidget {
final total = subtotal - memberDiscount + shipping;
// Log begin checkout analytics event
if (cartItemsData.isNotEmpty) {
AnalyticsService.logBeginCheckout(
value: total,
items: cartItemsData.map((itemData) {
final cartItem = itemData as CartItemData;
return AnalyticsEventItem(
itemId: cartItem.product.productId,
itemName: cartItem.product.name,
price: cartItem.product.basePrice,
quantity: cartItem.quantity.toInt(),
);
}).toList(),
);
}
return Scaffold(
backgroundColor: colorScheme.surfaceContainerLowest,
appBar: AppBar(