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

Cart Shipping Address and Method Fixes #391

Merged

Conversation

pmclain
Copy link
Contributor

@pmclain pmclain commented Feb 23, 2019

Description (*)

Manual testing scenarios (*)

  1. Create quote and set shipping address
  2. Query cart requesting shipping address id
query getCart($cartId:String!){
  cart(cart_id:$cartId){
    cart_id
    shipping_addresses{
      address_id
    }
  }
}
  1. Set shipping method for returned shipping address(es)
mutation setShippingMethod($cartId:String!, $addressId:Int!){
  setShippingMethodsOnCart(
    input:{
      cart_id:$cartId
      shipping_methods:[
        {
          cart_address_id:$addressId
          carrier_code:"flatrate"
          method_code:"flatrate"
        }
      ]
    }
  ) {
    cart{
      items{
        id
      }
    }
  }
}

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 on Travis CI are green)

This is required for setting quote address shipping methods
@@ -85,8 +85,8 @@ public function resolve(Field $field, $context, ResolveInfo $info, array $value
$this->setShippingMethodOnCart->execute(
$cart,
$shippingMethod['cart_address_id'],
$shippingMethod['shipping_carrier_code'],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please note. The shipping methods changes are already applied in a scope of the following PR
#342

@ghost
Copy link

ghost commented Feb 26, 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.

4 participants