magento / magento2

Prior to making any Submission(s), you must sign an Adobe Contributor License Agreement, available here at: https://opensource.adobe.com/cla.html. All Submissions you make to Adobe Inc. and its affiliates, assigns and subsidiaries (collectively “Adobe”) are subject to the terms of the Adobe Contributor License Agreement.
http://www.magento.com
Open Software License 3.0
11.46k stars 9.28k forks source link

If bundle item is OUT_OF_STOCK then it should not show at all #26109

Open TomashKhamlai opened 4 years ago

TomashKhamlai commented 4 years ago

Preconditions (*)

  1. Import [Uploading export_catalog_product.tar.gz…]()

Steps to reproduce (*)

  1. Filter products
    {
    products(
    filter: {
      category_id: {
        eq: "2"
      }
    }
    ) {
    items {
      sku
      stock_status
      ... on BundleProduct {
        ship_bundle_items
        weight
        dynamic_weight
        dynamic_sku
        dynamic_price
        items {
          option_id
          type
          title
          sku
          required
          options {
            can_change_quantity
            quantity
            product {
              sku
              stock_status
            }
            price_type
            price
            position
            label
            is_default
            id
          }
        }
      }
      ... on CustomizableProductInterface {
        options {
          option_id
          required
          sort_order
          title
          __typename
        }
      }
    }
    }
    }

Expected result (*)

  1. 2 items in multiselect image (1)

Actual result (*)

  1. 2 items + 1 empty item for any Product that is out of stock
    {
    "data": {
    "products": {
      "items": [
        {
          "sku": "b1-separately (bundle)",
          "stock_status": "IN_STOCK",
          "ship_bundle_items": "SEPARATELY",
          "weight": null,
          "dynamic_weight": false,
          "dynamic_sku": false,
          "dynamic_price": false,
          "items": [
            {
              "option_id": 1,
              "type": "multi",
              "title": "bund-opt-1-only",
              "sku": "b1-separately (bundle)",
              "required": true,
              "options": [
                {
                  "can_change_quantity": false,
                  "quantity": 1,
                  "product": null,
                  "price_type": "FIXED",
                  "price": 0,
                  "position": 1,
                  "label": null,
                  "is_default": true,
                  "id": 1
                },
                {
                  "can_change_quantity": false,
                  "quantity": 1,
                  "product": {
                    "sku": "bundle-simple-1-in",
                    "stock_status": "IN_STOCK"
                  },
                  "price_type": "FIXED",
                  "price": 0,
                  "position": 2,
                  "label": "bundle-simple-1-in",
                  "is_default": false,
                  "id": 2
                },
                {
                  "can_change_quantity": false,
                  "quantity": 2,
                  "product": {
                    "sku": "virtual-prod",
                    "stock_status": "IN_STOCK"
                  },
                  "price_type": "FIXED",
                  "price": 0,
                  "position": 3,
                  "label": "virtual-prod",
                  "is_default": false,
                  "id": 3
                }
              ]
            }
          ],
          "options": null
        },
        {
          "sku": "bundle-simple-1-in",
          "stock_status": "IN_STOCK",
          "options": null
        },
        {
          "sku": "virtual-prod",
          "stock_status": "IN_STOCK",
          "options": null
        }
      ]
    }
    }
    }
TomashKhamlai commented 4 years ago

Reproduced on magento/graphql-ce#396

m2-assistant[bot] commented 4 years ago

Hi @TomashKhamlai. Thank you for your report. To help us process this issue please make sure that you provided the following information:

Please make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, please, add a comment to the issue:

@magento give me 2.4-develop instance - upcoming 2.4.x release

For more details, please, review the Magento Contributor Assistant documentation.

@TomashKhamlai do you confirm that you were able to reproduce the issue on vanilla Magento instance following steps to reproduce?


magento-engcom-team commented 4 years ago

:white_check_mark: Confirmed by @lenaorobei Thank you for verifying the issue. Based on the provided information internal tickets MC-29907 were created

Issue Available: @lenaorobei, You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself.

m2-assistant[bot] commented 4 years ago

Hi @sedonik. Thank you for working on this issue. Looks like this issue is already verified and confirmed. But if you want to validate it one more time, please, go though the following instruction:


m2-assistant[bot] commented 4 years ago

Hi @mageshrdckap. Thank you for working on this issue. Looks like this issue is already verified and confirmed. But if you want to validate it one more time, please, go though the following instruction:


sedonik commented 4 years ago

Hi @TomashKhamlai

I've added method validateStockItem wich checks OUT_OF_STOCK parameter of the item. Could you check is it work for you?

Thanks.

sedonik commented 4 years ago

Hi @swnsma , @lenaorobei Could you check the solution? Thanks.

m2-assistant[bot] commented 3 months ago

Hi @engcom-Delta. Thank you for working on this issue. Looks like this issue is already verified and confirmed. But if you want to validate it one more time, please, go though the following instruction: