Skip to content
This repository was archived by the owner on Dec 19, 2019. It is now read-only.

Conversation

@VitaliyBoyko
Copy link
Contributor

Description (*)

Return an empty array of shipping addresses for the created empty cart until a shipping address
is set.

Fixed Issues (if relevant)

  1. The shipping address contains null values when there's no shipping address set on a cart #864: The shipping address contains null values when there's no shipping address set on a cart

@VitaliyBoyko VitaliyBoyko changed the title graphQl-864: Prevent to return a shipping address until it be set on a cart graphQl-864: Prevent to return a shipping address until it is set on a cart Aug 31, 2019
@magento-engcom-team
Copy link
Contributor

Hi @lenaorobei, thank you for the review.
ENGCOM-5770 has been created to process this Pull Request
✳️ @lenaorobei, could you please add one of the following labels to the Pull Request?

Label Description
Auto-Tests: Covered All changes in Pull Request is covered by auto-tests
Auto-Tests: Not Covered Changes in Pull Request requires coverage by auto-tests
Auto-Tests: Not Required Changes in Pull Request does not require coverage by auto-tests

@cpartica
Copy link
Contributor

cpartica commented Sep 5, 2019

The problem is that the quote api creates empty addresses placeholders before we even set them and has nothing to do with getShippingAssignments. You can set addresses independently before choosing a shipping method.

This fix is not sufficient as it breaks further if you set a shipping address but not select a shipping method, we're not returning anything and we should..
example:
let's say we set a setShippingAddressesOnCart
then we query:

query {
  cart(cart_id: "eVt0JvTe7qAm6arhkHZYEQjvcFRoiZ8C") {
   shipping_addresses {
      lastname
      firstname
      available_shipping_methods {
      carrier_code
    	}
      selected_shipping_method {
        carrier_code
        carrier_title
        method_code
        method_title
      }
    }
  }
}

Expected response:

{
  "data": {
    "cart": {
      "shipping_addresses": [
        {
          "lastname": "test lastname",
          "firstname": "test firstname",
          "available_shipping_methods": [
            {
              "carrier_code": "flatrate"
            }
          ],
          "selected_shipping_method": null
        }
      ]
    }
  }
}

Actual

{
  "data": {
    "cart": {
      "shipping_addresses": []
    }
  }
}

@magento-engcom-team magento-engcom-team merged commit 66290e6 into 2.3-develop Sep 11, 2019
@okorshenko okorshenko deleted the GraphQl-864-do-not-return-shipping-address-when-it-not-set branch December 18, 2019 22:21
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants