Skip to content
This repository has been archived by the owner on Oct 31, 2024. It is now read-only.

[BUG] add-to-cart notification not working anymore #1304

Closed
niklaswolf opened this issue Jan 15, 2021 · 2 comments · Fixed by #1334
Closed

[BUG] add-to-cart notification not working anymore #1304

niklaswolf opened this issue Jan 15, 2021 · 2 comments · Fixed by #1334
Assignees
Labels
bug Something isn't working prio-1

Comments

@niklaswolf
Copy link
Collaborator

Describe the bug

The add-to-cart isn't working anymore, this can be tested in the demo shop https://shopware-pwa.storefrontcloud.io.
When adding a product to the cart, a notification was and should be shown.

I think the cause is, that the i18n-plugin is not injected properly and thus undefined when using it in logic/notifications/index.js (

rootContext.i18n.t("{productName} has been added to cart.", {
) which is used in the notifications-plugin

All other plugins use the inject function which would make i18n available in other plugins, too.
This issue is described here https://medium.com/@valerka/how-to-register-the-plugin-correctly-in-nuxt-js-91ed2d95b81f.

I think it has worked until some time ago only by chance, maybe the loading order has changed or something like that.
I think the i18n plugin has to be injected properly to be also available in other plugins :)

@niklaswolf niklaswolf added the bug Something isn't working label Jan 15, 2021
@develth
Copy link
Contributor

develth commented Jan 29, 2021

Hmmm, i didn´t even get a onAddToCart intercept, like described in docs...

@develth
Copy link
Contributor

develth commented Jan 29, 2021

Yip, the mentioned i18n breaks it. When change it to rootContext._i18n it works

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working prio-1
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants