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

Message "The Cart includes virtual product(s) only, so a shipping add ress is not used." #406

Closed
wants to merge 4 commits into from

Conversation

XxXgeoXxX
Copy link
Member

Description (*)

Issue #401

Manual testing scenarios (*)

Preconditions (*)

  1. Registered Customer
  2. Virtual Product
  3. Developer mode

Steps to reproduce (*)

  1. Log in as Registered Customer
  2. Add Product to Cart
  3. Get Customer token
  4. Get ADDRESS_ID by hovering 'Change Billing Address' or 'Change Shipping Address'
  5. Get CART_ID by createEmptyCart mutation (It returns active CART_ID)
  6. In GraphQL Client add authorization header and execute
mutation {
  setShippingAddressesOnCart(
    input: {
      cart_id: "4P41sMzbNyca3pwMcO4Q5j7m0RNmmvDW"
      shipping_addresses: {
        customer_address_id: 3
        cart_items: {
          cart_item_id: 8
          quantity: 1
        }
      }
    }
  ) {
    cart {
      cart_id
      shipping_addresses {
        address_type
        available_shipping_methods {
          carrier_code
          carrier_title
          method_code
          method_title
          price_excl_tax
          price_incl_tax
        }
        selected_shipping_method {
          amount
          amount
        }
      }
    }
  }
}

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)

@@ -67,6 +67,11 @@ public function __construct(
*/
public function execute(ContextInterface $context, CartInterface $cart, array $shippingAddresses): void
{
if ($cart->getIsVirtual()) {
Copy link
Contributor

Choose a reason for hiding this comment

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

We need to move this check on a higher level to \Magento\QuoteGraphQl\Model\Resolver\SetShippingAddressesOnCart::resolve
Also. need to cover case with API-functional tests

Copy link
Member Author

Choose a reason for hiding this comment

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

Done. add try-catch wrapper and api-functional test

@naydav
Copy link
Contributor

naydav commented Feb 26, 2019

@TomashKhamlai
Please, verify that we have this case in HipTest
Thanks

@naydav
Copy link
Contributor

naydav commented Feb 27, 2019

Functionality was merged with #330

@naydav naydav closed this Feb 27, 2019
@ghost
Copy link

ghost commented Feb 27, 2019

Hi @XxXgeoXxX, 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.

3 participants