Skip to content

Conversation

@psmyrek
Copy link
Contributor

@psmyrek psmyrek commented Feb 13, 2020

Short Description and Why It's Useful

Currently, if totals key is added to product in cart, it is not detected by Vue, because Vue cannot detect property addition or deletion. To do this right we should use Vue.set().
Currently the only way to refresh the view after totals in product in cart have been added/changed is listening to cart-after-itemchanged and then calling $forceUpdate().

Screenshots of Visual Changes before/after (if There Are Any)

No visual changes.

Which Environment This Relates To

Check your case. In case of any doubts please read about Release Cycle

  • Test version (https://test.storefrontcloud.io) - this is a new feature or improvement for Vue Storefront. I've created branch from develop branch and want to merge it back to develop
  • RC version (https://next.storefrontcloud.io) - this is a stabilisation fix for Release Candidate of Vue Storefront. I've created branch from release branch and want to merge it back to release
  • Stable version (https://demo.storefrontcloud.io) - this is an important fix for current stable version. I've created branch from hotfix or master branch and want to merge it back to hotfix

Upgrade Notes and Changelog

  • No upgrade steps required (100% backward compatibility and no breaking changes)
  • I've updated the Upgrade notes and Changelog on how to port existing Vue Storefront sites with this new feature

IMPORTANT NOTICE - Remember to update CHANGELOG.md with description of your change

Contribution and Currently Important Rules Acceptance

@psmyrek psmyrek requested a review from andrzejewsky February 13, 2020 08:11
if (record) {
EventBus.$emit('cart-before-itemchanged', { item: record })
record = Object.assign(record, product)
Object.entries(product).forEach(([key, value]) => Vue.set(record, key, value))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it shouldn't be such a logic inside of mutation... but I understand that is the only solution

@andrzejewsky andrzejewsky merged commit 4c8cdc5 into vuestorefront:hotfix/v1.11.2 Feb 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants