magento / graphql-ce

[ARCHIVED] Please use magento/magento2 project
https://github.com/magento/magento2
Open Software License 3.0
131 stars 156 forks source link

selected_shipping_method received twice even if multishipping was disabled #508

Closed TomashKhamlai closed 5 years ago

TomashKhamlai commented 5 years ago

Preconditions (*)

There were lot of settings. Write a comment if not reproducible

  1. Setup Magento to support all the shipping methods or at least UPS

Steps to reproduce (*)

  1. Generate Customer token
  2. Create empty cart
  3. Set shipping address on empty cart
  4. Try to set any shipping method and get the error
  5. Add simple product to cart with qty 7
  6. Try to set the next shipping method
    mutation {
    setShippingMethodsOnCart(
    input: {
      cart_id: "{{ YOUR VALUE }}"
      shipping_methods: {
        cart_address_id: {{ YOUR VALUE }}
        carrier_code: "ups"
        method_code: "GND"
      }
    }
    ) {
    cart {
      shipping_addresses {
        selected_shipping_method {
          carrier_code
          method_code
          label
          amount
        }
        available_shipping_methods {
          carrier_title
          method_title
          price_incl_tax
          base_amount
          price_excl_tax
          amount
        }
      }
    }
    }
    }
  7. Disable Multishipping
  8. Examine the cart:
    query {
    cart(cart_id: "{{ YOUR VALUE }}")
    {
    shipping_addresses {
      selected_shipping_method {
        carrier_code
        method_code
      }
    }
    }
    }

Expected result (*)

  1. selected_shipping_method only once
    {
    "data": {
    "cart": {
      "shipping_addresses": [
        {
          "selected_shipping_method": {
            "carrier_code": ups,
            "method_code": GND
          }
        }
      ]
    }
    }
    }

    Actual result (*)

  2. selected_shipping_method only twice
    {
    "data": {
    "cart": {
      "shipping_addresses": [
        {
          "selected_shipping_method": {
            "carrier_code": null,
            "method_code": null
          }
        },
        {
          "selected_shipping_method": {
            "carrier_code": "ups",
            "method_code": "GND"
          }
        }
      ]
    }
    }
    }
TomashKhamlai commented 5 years ago

Not a bug

TomashKhamlai commented 5 years ago

Just a good test case for future checks of #404. @naydav, please verify that Customer can set any number of addresses on preparing cart for checkout and please prepare some expectations for the case when Multishipping was disabled unexpectedly for Customers

naydav commented 5 years ago

We could not consider that is a bug. State of the system was changed during checkout workflow.