Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"cataloginventory_stock" event #4857

Closed
myownspace opened this issue Jun 3, 2016 · 8 comments
Closed

"cataloginventory_stock" event #4857

myownspace opened this issue Jun 3, 2016 · 8 comments
Labels
bug report Component: Catalog Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development

Comments

@myownspace
Copy link

I can't observe "cataloginventory_stock" event because in \Magento\CatalogInventory\Model\Stock model
property named $eventPrefix instead of $_eventPrefix

@mslabko
Copy link
Member

mslabko commented Jun 8, 2016

Hi @myownspace ,
Thank you for reporting! Internal ticket created: MAGETWO-54066
As a workaround you can use plugin for public method for add additional behaviour to model

@mslabko mslabko added the Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development label Jun 8, 2016
@vkorotun vkorotun removed the MX label Aug 4, 2016
@Silarn
Copy link

Silarn commented Feb 8, 2017

Is there a reason this fix hasn't been released yet?

I just realised that this also requires a fix to the $_eventObject attribute name. Without this fix the event always passes the event data as 'Object' instead of the expected 'Stock' and 'Item'.

@tmotyl
Copy link
Contributor

tmotyl commented Apr 25, 2017

Hi @mslabko any idea when this patch will be released ? It's a pitty that issues fixed so long time ago are still pending for release.

@mslabko
Copy link
Member

mslabko commented May 25, 2017

Hi @tmotyl , @Silarn As I can see issue was fixed in bffd1c0 but code is not includes fix for $_eventObject
I've reopened internal ticket. Sorry for delay response

magento-team pushed a commit that referenced this issue Jun 15, 2017
MAGETWO-54066: [GITHUB] Invalid event prefix for catalog inventory #4857
@veloraven
Copy link
Contributor

This issue was fixed in develop branch.
Closed.

@apedicdev
Copy link
Contributor

apedicdev commented Jul 29, 2017

should the event cataloginventory_stock_item_save_after dispatched on any inventory change? I'm able to use use it on admin but not after and order is placed

@Silarn
Copy link

Silarn commented Jul 29, 2017

No, there are several events you'll need to hook into to cover all possibilities. There's a free Magento 1 plugin which covers these cases and I think it's roughly the same in Magento 2. I'll find it and add it to this post shortly.

https://github.com/jreinke/magento-stock-movements

@apedicdev
Copy link
Contributor

apedicdev commented Jul 30, 2017

thank you @Silarn, currently working on a M2 version https://github.com/apedicdev/m2_stock-movement

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug report Component: Catalog Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development
Projects
None yet
Development

No branches or pull requests

7 participants