kathyisawesome / wc-mnm-variable

Variable Mix and Match Products
2 stars 0 forks source link

[v2] Switching to a variation that was loaded already does NOT update the UI status #48

Closed helgatheviking closed 8 months ago

helgatheviking commented 9 months ago

On the frontend, I can swap from 10 to 25 to 50, but then if I go back to a lower amount it seems to get stuck on 50 quantity in the counter at the bottom. (Ignore 20/25 not matching up, that was just me mis-naming the variation).

See video recording: https://drive.google.com/file/d/1BCmkh3gYEpNSnjYNlEdKxkV_E9NoZlIY/view?usp=sharing

From @simplicity17

helgatheviking commented 9 months ago

Updating the title because it's not that it's just a downsize... it's changing to any variation that was already loaded the first time. The data store's container does NOT change, which cascades to not revalidating nor updating the status UI messaging.

Basically select( CONTAINER_STORE_KEY ).getContainer( productId, variationId ) does not get RESOLVED each time and loads the container that is in the store.

possibly need to separate getContainer() from some kind of fetchContainer() and/or force the container in the data store to reset.

helgatheviking commented 8 months ago

@simplicity17 heads up... I think i fixed this bug!! Test out beta 4 if you have time.

There are still a few more bugs, but that was a major one. Thanks for pointing it out