[Woo POS] Fix order sync from passing empty items for the products #13205
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Part of #12998
Description
After merging #13188 and testing the WIP #13191, I realized that the order sync stopped working because the dashboard VM is still using the
items: [POSItem]
internal variable that isn't set anymore after extracting the item selector logic in #13188. Without the item list, order sync cannot properly set the order line items in the API request and it results in 0 order total and an empty order in core. This PR fixes it by removing theitems
variable and replacing its usage in order sync withitemSelectorViewModel.items
.Steps to reproduce
Prerequisite: the store is eligible for POS and the feature switch is enabled in Menu > Settings > Experimental Features > POS
Checkout
--> the order total should be updated to a correct, non-zero value (before this PR in trunk, the order total is always 0 after the sync)Testing information
Screenshots
Simulator.Screen.Recording.-.iPad.10th.generation.-.2024-06-28.at.16.36.37.mp4
RELEASE-NOTES.txt
if necessary.