magento2 icon indicating copy to clipboard operation
magento2 copied to clipboard

After disabling MSI all modules, adding bundle product to cart via REST API not working properly

Open lokborn opened this issue 1 year ago • 5 comments

Preconditions and environment

  • Magento ver. 2.4.2-p2 (EE) or (CE)
  • install Magento ver. 2.4.2-p2 Enterprise edition or community edition, disable all MSI modules and try to add bundle product to cart using REST API

Steps to reproduce

  1. Create a bundle product in backend having 2 or more options and each option having single product and required.

  2. Set the last product QTY of the option to more than 1.

  3. Disable all MSI modules like using this command: sudo php bin/magento module:disable Magento_Inventory Magento_InventoryAdminUi Magento_InventoryApi Magento_InventoryBundleProduct Magento_InventoryBundleProductAdminUi Magento_InventoryCatalog Magento_InventorySales Magento_InventoryCatalogAdminUi Magento_InventoryCatalogApi Magento_InventoryCatalogSearch Magento_InventoryConfigurableProduct Magento_InventoryConfigurableProductIndexer Magento_InventoryConfiguration Magento_InventoryConfigurationApi Magento_InventoryDistanceBasedSourceSelectionAdminUi Magento_InventoryDistanceBasedSourceSelectionApi Magento_InventoryElasticsearch Magento_InventoryExportStockApi Magento_InventoryIndexer Magento_InventorySalesApi Magento_InventoryGroupedProduct Magento_InventoryGroupedProductAdminUi Magento_InventoryGroupedProductIndexer Magento_InventoryImportExport Magento_InventorySourceSelectionApi Magento_InventoryCache Magento_InventoryLowQuantityNotification Magento_InventoryLowQuantityNotificationApi Magento_InventoryMultiDimensionalIndexerApi Magento_InventoryProductAlert Magento_InventoryReservations Magento_InventoryReservationCli Magento_InventoryReservationsApi Magento_InventoryExportStock Magento_InventorySalesAdminUi Magento_CatalogInventoryGraphQl Magento_InventorySalesFrontendUi Magento_InventorySetupFixtureGenerator Magento_InventoryShipping Magento_InventoryShippingAdminUi Magento_InventorySourceDeductionApi Magento_InventorySourceSelection Magento_InventoryConfigurableProductAdminUi Magento_InventoryLowQuantityNotificationAdminUi Magento_InventoryBundleProductIndexer Magento_InventoryInStorePickupAdminUi Magento_InventoryInStorePickup Magento_InventoryInStorePickupQuote Magento_InventoryVisualMerchandiser Magento_InventoryInStorePickupSalesAdminUi Magento_InventoryGraphQl Magento_InventoryAdvancedCheckout Magento_InventoryCatalogFrontendUi Magento_InventoryDistanceBasedSourceSelection Magento_InventoryInStorePickupApi Magento_InventoryInStorePickupGraphQl Magento_InventoryInStorePickupSales Magento_InventoryInStorePickupShipping Magento_InventoryRequisitionList Magento_InventoryInStorePickupFrontend Magento_InventoryConfigurableProductFrontendUi Magento_InventoryBundleImportExport Magento_InventoryInStorePickupShippingApi Magento_InventoryInStorePickupQuoteGraphQl Magento_InventoryInStorePickupSalesApi Magento_InventoryInStorePickupShippingAdminUi Magento_InventorySwatchesFrontendUi Magento_InventoryWishlist Magento_InventoryInStorePickupMultishipping Magento_InventoryInStorePickupWebapiExtension

  4. Example : ENDPOINT : /rest/V1/carts/mine/items TYPE: POST REQUEST: { "cartItem": { "qty": 1, "quoteId": "99264", "sku": "testbund2", "product_option": { "extension_attributes": { "bundle_options": [ { "option_id": 9, "option_qty": 1, "option_selections": [ 17 ] }, { "option_id": 10, "option_qty": 1, "option_selections": [ 18 ] }, { "option_id": 11, "option_qty": 2, "option_selections": [ 19 ] } ] } } } }

Expected result

{ "item_id": 86590, "sku": "testbund2", "qty": 1, "name": "Bundle product 2", "price": 4705, "product_type": "bundle", "quote_id": "99264", "product_option": { "extension_attributes": { "bundle_options": [ { "option_id": 9, "option_qty": 1, "option_selections": [ 17 ] }, { "option_id": 10, "option_qty": 1, "option_selections": [ 18 ] }, { "option_id": 11, "option_qty": 2, "option_selections": [ 19 ] } ] } } }

Actual result

{ "item_id": 86590, "sku": "testbund2", "qty": 2, "name": "Bundle product 2", "price": 4705, "product_type": "bundle", "quote_id": "99264", "product_option": { "extension_attributes": { "bundle_options": [ { "option_id": 9, "option_qty": 1, "option_selections": [ 17 ] }, { "option_id": 10, "option_qty": 1, "option_selections": [ 18 ] }, { "option_id": 11, "option_qty": 2, "option_selections": [ 19 ] } ] } } }

Additional information

So, whatever the last option qty we have set, it reflect the same for main bundle product .i.e parent bundle. In the above example, I set the last option product qty as 2, so it is adding 2 bundle product in cart.

Release note

No response

Triage and priority

  • [x] Severity: S0 - Affects critical data or functionality and leaves users without workaround.
  • [x] Severity: S1 - Affects critical data or functionality and forces users to employ a workaround.
  • [ ] Severity: S2 - Affects non-critical data or functionality and forces users to employ a workaround.
  • [ ] Severity: S3 - Affects non-critical data or functionality and does not force users to employ a workaround.
  • [ ] Severity: S4 - Affects aesthetics, professional look and feel, “quality” or “usability”.

lokborn avatar Dec 11 '23 07:12 lokborn

Hi @lokborn. Thank you for your report. To speed up processing of this issue, make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, Add a comment to the issue:


Join Magento Community Engineering Slack and ask your questions in #github channel. :warning: According to the Magento Contribution requirements, all issues must go through the Community Contributions Triage process. Community Contributions Triage is a public meeting. :clock10: You can find the schedule on the Magento Community Calendar page. :telephone_receiver: The triage of issues happens in the queue order. If you want to speed up the delivery of your contribution, join the Community Contributions Triage session to discuss the appropriate ticket.

m2-assistant[bot] avatar Dec 11 '23 07:12 m2-assistant[bot]

Hi @engcom-Dash. Thank you for working on this issue. In order to make sure that issue has enough information and ready for development, please read and check the following instruction: :point_down:

    1. Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).
    1. Verify that issue has a meaningful description and provides enough information to reproduce the issue.
    1. Add Area: XXXXX label to the ticket, indicating the functional areas it may be related to.
    1. Verify that the issue is reproducible on 2.4-develop branch
      Details- Add the comment @magento give me 2.4-develop instance to deploy test instance on Magento infrastructure.
      - If the issue is reproducible on 2.4-develop branch, please, add the label Reproduced on 2.4.x.
      - If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and stop verification process here!

m2-assistant[bot] avatar Dec 27 '23 13:12 m2-assistant[bot]

Hi @lokborn

Thanks for reporting and collaboration.

It is not advisable to disable the MSI modules.Can you please provide the use cases for which you need to disable the MSI modules.

engcom-Dash avatar Dec 28 '23 05:12 engcom-Dash

Hi @engcom-Dash

I have disabled all MSI modules as we do not need multiinventory setup in our case. Also, it improves the performance of multiple APIs.

lokborn avatar Dec 28 '23 06:12 lokborn

Hi @lokborn

Thanks for reporting and collaboration.

As per the adobe dev docs, Disabling the Inventory Management modules can cause an unstable system and result in various issues.

Please refer the below devdocs for more information :

https://experienceleague.adobe.com/docs/commerce-admin/inventory/get-started/install-update.html

Thanks

engcom-Dash avatar Jan 10 '24 13:01 engcom-Dash

Hi @lokborn

We have noticed that this issue has not been updated since long time.
Hence we assume that this issue is fixed now, so we are closing it. Please feel to raise a fresh ticket or reopen this ticket if you need more assistance on this.

Thanks.

engcom-Dash avatar Jan 23 '24 12:01 engcom-Dash