Skip to content

Commit 0d8432d

Browse files
committed
Trigger add_product_save_as_draft_tapped from product preview action
1 parent cd381c4 commit 0d8432d

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

WooCommerce/Classes/ViewRelated/Products/Edit Product/ProductFormViewController.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,10 @@ final class ProductFormViewController<ViewModel: ProductFormViewModelProtocol>:
202202
// MARK: Product preview action handling
203203

204204
@objc private func saveDraftAndDisplayProductPreview() {
205+
if viewModel.formType == .add {
206+
ServiceLocator.analytics.track(.addProductSaveAsDraftTapped, withProperties: ["product_type": product.productType.rawValue])
207+
}
208+
205209
guard viewModel.canSaveAsDraft() || viewModel.hasUnsavedChanges() else {
206210
displayProductPreview()
207211
return

0 commit comments

Comments
 (0)