Vue-storefront: Add Magento 2.3 - MSI support for stock checks

Created on 31 Jan 2019  Â·  11Comments  Â·  Source: DivanteLtd/vue-storefront

What is the motivation for adding / enhancing this feature?

With Magento 2.3 there is MSI module included for managing the stocks.
We should add support for it to mage2vuestorefront

https://devdocs.magento.com/redoc/2.3/admin-rest-api.html#operation/inventorySourceSelectionApiSourceSelectionServiceV1ExecutePost

What are the acceptance criteria

  • mage2vuestorefront correctly sets the product available for both: Magento 2.2.x and 2.3.x

Can you complete this feature request by yourself?

Additional information

Urgent feature request help wanted vs-hackathon

Most helpful comment

I'll try to work on this

All 11 comments

Related to: #2295

To solve this task we should modify:

  • mage2vuestorefront stock sync
  • vue-storefront-api dynamic stock sync - one endpoint is for getting the single stock item, second is for getting the list of stock items.

The thing is, that all the business logic above operates on Magento-like Stock object which is synced with product.stock. The minimum set of fields of product.stock are:

  • is_in_stock - true/false
  • qty - salable quantity.

The stock object is few different locations of Vue Storefront source. So it's important to keep MSI compatible with it:

What we need is to modify the mage2vuestorefront + vue-storefront-api that in case MSI is enabled (and only in that case - it could be set in vue-storefront-api/config/default.json / mage2vuestorefront/src/config.js or verified other way with Magento2 API) we should probably aggregate the product.stock information (qty and is_in_stock) of source items

I mean - the product.stock should reflect or maybe render the MSI logic but for Vue Storefront it should be transparent if there is an MSI enabled or not.

Note: if the product is configurable - then the same stock object but for the simple products should be rendered to configurable_children.*.stock

Moreover, we could extend mage2vuestorefront to put the source items into product.stock_source_items to just let the VS developers display the available source items for each product. But for core visibility checks it should be just the product.stock

I'll try to work on this

Hello,
we have written our analysis in this document: http://bit.ly/vuesf-msi

We'll start working on a proof of concept soon.

If anyone has suggestions/concerns, feel free to comment on the document or here.

Thanks! Great job with the analysis document, looks great. Looking forward for the PoC.

Please note that we’re also checking the stock options per configurable child and filter out unavailable variants. It’s done runtime (thru vsapi and then direct call to magento to get the current t stock); not in the mage2vs / it’s the only way to make sure that the product is in stock / not relying on the Elastic / cached stock information which probably isn’t accurate and synced

For the main configurable product we should just “emulate” the stock / setting the product to “is_in_stock” if at least one child is available.

Hello @pkarw if I get it well, data pumping will be soon replaced by the native Vue Storefront Magento2 Indexer.

According to this change, is it ok for us to work on integrating MSI on it rather than on the (deprecated?) Data Pump?

Let us know, meanwhile we're working on vue-storefront-api.

Dear Allesandro, our official production recommendation currently is mage2vuestorefront - so I believe we should add MSI support to it first. I'm adding URL routing currently - and also the first place is m2vs :)

We need few more weeks (maybe months) to make magento2-vsbridge-indexer stable. So I would like to ask You to go on with m2vs and then we'll copy this behavior to native bridge.

If You think it would be easier for You to work on bridge natively there is then an option to add the support to mafgento2-vsbrdige-indexer exclusively which will make a great argument for users to just use it.

Let me know which way You'd like to proceed?

If You add the logic to native indexer first then probably we'll just copy it to m2vs anyway :)

hello @pkarw no problem, we'll go on working on m2vs as well, thanks for sharing the roadmap

Done with: https://github.com/DivanteLtd/vue-storefront-api/pull/226/
Thanks @dimasch and @aleron75

Waiting for final changes to mage2vuestorefront + magento2-vsbridge-indexer

Was this page helpful?
0 / 5 - 0 ratings

Related issues

revlis-x picture revlis-x  Â·  3Comments

sandermangel picture sandermangel  Â·  5Comments

JuliaBonita picture JuliaBonita  Â·  5Comments

talalus picture talalus  Â·  4Comments

filrak picture filrak  Â·  4Comments