File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed
WooCommerce/Classes/ViewRelated/Products/Variations Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -697,6 +697,13 @@ private extension ProductVariationsViewController {
697697 let notice = Notice ( title: Localization . variationsCreatedTitle)
698698 noticePresenter. enqueue ( notice: notice)
699699 }
700+
701+ /// Updates the current product with the up-to-date list of variations IDs.
702+ /// This is needed in order to reflect variations count changes back to this and to other screens.
703+ ///
704+ private func updateProductVariationCount( ) {
705+ self . product = product. copy ( variations: resultsController. fetchedObjects. map { $0. productVariationID } )
706+ }
700707}
701708
702709// MARK: - Placeholders
@@ -786,6 +793,7 @@ extension ProductVariationsViewController: SyncingCoordinatorDelegate {
786793 case . finished( let variationsCreated) :
787794 self ? . dismissBlockingIndicator ( )
788795 if variationsCreated {
796+ self ? . updateProductVariationCount ( )
789797 self ? . presentVariationsCreatedNotice ( )
790798 } else {
791799 self ? . presentNoGenerationNotice ( )
You can’t perform that action at this time.
0 commit comments