add logs
This commit is contained in:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user