File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
WooCommerce/Classes/ViewRelated/Products/Variations Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -73,7 +73,8 @@ final class GenerateAllVariationsUseCase {
7373
7474 case . failure( let error) :
7575 onStateChanged ( . error( . unableToFetchVariations) )
76- DDLogError ( " ⛔️ Failed to create variations: \( error) " )
76+ DDLogError ( " ⛔️ Failed to fetch variations: \( error) " )
77+ analytics. track ( event: . Variations. productVariationGenerationFailure ( ) )
7778 }
7879 }
7980 }
@@ -96,13 +97,16 @@ private extension GenerateAllVariationsUseCase {
9697 onCompletion: @escaping ( Result < [ ProductVariation ] , GenerationError > ) -> Void ) {
9798 let action = ProductVariationAction . createProductVariations ( siteID: product. siteID,
9899 productID: product. productID,
99- productVariations: variations, onCompletion: { result in
100+ productVariations: variations, onCompletion: { [ analytics ] result in
100101 switch result {
101102 case . success( let variations) :
102103 onCompletion ( . success( variations) )
104+ analytics. track ( event: . Variations. productVariationGenerationSuccess ( ) )
105+
103106 case . failure( let error) :
104107 onCompletion ( . failure( . unableToCreateVariations) )
105108 DDLogError ( " ⛔️ Failed to create variations: \( error) " )
109+ analytics. track ( event: . Variations. productVariationGenerationFailure ( ) )
106110 }
107111 } )
108112 stores. dispatch ( action)
You can’t perform that action at this time.
0 commit comments