File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
WooCommerce/Classes/ViewRelated/Orders/Order Creation Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -436,8 +436,8 @@ private extension NewOrderViewModel {
436436 /// Adds a selected product (from the product list) to the order.
437437 ///
438438 func addProductToOrder( _ product: Product ) {
439- let newOrderItem = NewOrderItem ( product: product, quantity: 1 )
440- orderDetails . items . append ( newOrderItem )
439+ let input = OrderSyncProductInput ( product: . product( product ) , quantity: 1 )
440+ orderSynchronizer . setProduct . send ( input )
441441 configureProductRowViewModels ( )
442442
443443 analytics. track ( event: WooAnalyticsEvent . Orders. orderProductAdd ( flow: . creation) )
@@ -446,8 +446,8 @@ private extension NewOrderViewModel {
446446 /// Adds a selected product variation (from the product list) to the order.
447447 ///
448448 func addProductVariationToOrder( _ variation: ProductVariation ) {
449- let newOrderItem = NewOrderItem ( variation : variation, quantity: 1 )
450- orderDetails . items . append ( newOrderItem )
449+ let input = OrderSyncProductInput ( product : . variation( variation ) , quantity: 1 )
450+ orderSynchronizer . setProduct . send ( input )
451451 configureProductRowViewModels ( )
452452
453453 analytics. track ( event: WooAnalyticsEvent . Orders. orderProductAdd ( flow: . creation) )
You can’t perform that action at this time.
0 commit comments