Skip to content

Commit 72a5edd

Browse files
committed
Move event call to view
The event is called wrongly when we create a new order, this is consequence of a side-effect of the system clearing the cart when a new order starts, which also triggers the event.
1 parent 1bafc53 commit 72a5edd

File tree

2 files changed

+1
-1
lines changed

2 files changed

+1
-1
lines changed

WooCommerce/Classes/POS/Models/PointOfSaleAggregateModel.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,6 @@ extension PointOfSaleAggregateModel {
135135

136136
func removeAllItemsFromCart() {
137137
cart.removeAll()
138-
analytics.track(.pointOfSaleClearCartTapped)
139138
}
140139

141140
func addMoreToCart() {

WooCommerce/Classes/POS/Presentation/CartView.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ struct CartView: View {
4747

4848
Button {
4949
posModel.removeAllItemsFromCart()
50+
ServiceLocator.analytics.track(.pointOfSaleClearCartTapped)
5051
} label: {
5152
Text(Localization.clearButtonTitle)
5253
}

0 commit comments

Comments
 (0)