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

Correct cart_item_id source for address items #853

Merged
merged 4 commits into from
Oct 22, 2019

Conversation

pmclain
Copy link
Contributor

@pmclain pmclain commented Aug 24, 2019

Description (*)

\Magento\Quote\Model\Quote\Address::getAlItems returns
\Magento\Quote\Model\Quote\Address\Item[] when the quote has multiple
shipping addresses and Magento\Quote\Model\Quote\Item[] with a single
shipping address. These objects have different methods for accessing the quote
item id and both variants need to be accommodated in the extractor.

Fixed Issues

  1. Cannot return null for non-nullable field CartItemQuantity.cart_item_id. #822

Manual testing scenarios (*)

  1. Create empty cart
  2. Add non-virtual product to cart
  3. Set shipping address on cart
  4. Query cart shipping address requesting cart.shipping_addresses.cart_items.cart_item_id
query {
  cart (cart_id: "{$maskedQuoteId}") {
    shipping_addresses {
      cart_items {
        cart_item_id
        quantity
      }
      available_shipping_methods {
        amount {
          value
          currency
        }
        base_amount {
          value
          currency
        }
        carrier_code
        carrier_title
        error_message
        method_code
        method_title
        price_excl_tax {
          value
          currency
        }
        price_incl_tax {
          value
          currency
        }
      }
    }
  }
}

Questions or comments

Contribution checklist (*)

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/integration tests (if applicable)
  • All automated tests passed successfully (all builds are green)

[`\Magento\Quote\Model\Quote\Address::getAllItems`](https://github.com/magento/magento2/blob/cf4dc427fed594f74b7168735ee1eb93febfc143/app/code/Magento/Quote/Model/Quote/Address.php#L592-L636) returns
`\Magento\Quote\Model\Quote\Address\Item[]` when the quote has multiple
shipping addresses and `Magento\Quote\Model\Quote\Item[]` with a single
shipping address. These objects have different methods for accessing the quote
item id and both variants need to be accommodated in the extractor.

Fixes magento#822
@pmclain
Copy link
Contributor Author

pmclain commented Aug 26, 2019

@magento run Functional Tests build

@magento-engcom-team
Copy link
Contributor

Hi @lenaorobei, thank you for the review.
ENGCOM-5699 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

@ghost
Copy link

ghost commented Oct 22, 2019

Hi @pmclain, thank you for your contribution!
Please, complete Contribution Survey, it will take less than a minute.
Your feedback will help us to improve contribution process.

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