magento / magento2

Prior to making any Submission(s), you must sign an Adobe Contributor License Agreement, available here at: https://opensource.adobe.com/cla.html. All Submissions you make to Adobe Inc. and its affiliates, assigns and subsidiaries (collectively “Adobe”) are subject to the terms of the Adobe Contributor License Agreement.
http://www.magento.com
Open Software License 3.0
11.48k stars 9.29k forks source link

Add customer_address_id to CartAddressInterface #32938

Open niklaswolf opened 3 years ago

niklaswolf commented 3 years ago

As a developer I want to get the customer_address_id of cart addresses so that I can match them easily with the other addresses a customer has saved in his customer addresses. Right now you have to do basically a string compare with a combination of fields to get a match, which in fact doesn't have to be a match because you can create different customer addresses with exactly the same values.

Added info from @paales As a developer I want to know the customer_address_id on a CartAddress so that I know if a customer has selected one of the customer addresses

mutation SetCustomerShippingAddressOnCart($cartId: String!, $customerAddressId: Int!) {
  setShippingAddressesOnCart(
    input: { cart_id: $cartId, shipping_addresses: [{ customer_address_id: $customerAddressId }] }
  ) {
    cart {
      id
      __typename
      shipping_addresses {
        id
        customer_address_id
      }
      billing_address {
        id
        customer_address_id
      }
    }
  }
}

Schema

Current CartAddressInteface

Add these fields:

interface CartAddressInterface {
    id: ID!
    customer_address_id: ID @doc(description: "Reference to customer address")
}

If the CustomerAddress has implemented the uid we'd like to have customer_address_uid

AC

m2-assistant[bot] commented 3 years ago

Hi @niklaswolf. Thank you for your report. To help us process this issue please make sure that you provided the following information:

Please make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, please, add a comment to the issue:

@magento give me 2.4-develop instance - upcoming 2.4.x release

For more details, please, review the Magento Contributor Assistant documentation.

Please, add a comment to assign the issue: @magento I am working on this


:clock10: You can find the schedule on the Magento Community Calendar page.

:telephone_receiver: The triage of issues happens in the queue order. If you want to speed up the delivery of your contribution, please join the Community Contributions Triage session to discuss the appropriate ticket.

:movie_camera: You can find the recording of the previous Community Contributions Triage on the Magento Youtube Channel

:pencil2: Feel free to post questions/proposals/feedback related to the Community Contributions Triage process to the corresponding Slack Channel

m2-assistant[bot] commented 3 years ago

Hi @engcom-Golf. Thank you for working on this issue. In order to make sure that issue has enough information and ready for development, please read and check the following instruction: :point_down:

m2-assistant[bot] commented 2 years ago

Hi @engcom-November. Thank you for working on this issue. In order to make sure that issue has enough information and ready for development, please read and check the following instruction: :point_down:

engcom-November commented 2 years ago

As per Magento docs customer_address_id is not added yet for CartAddressInterface which is existing behavior. Adding Feature Request label as this can be considered as Feature request but not bug.

paales commented 2 years ago

As a developer I want to know the customer_address_id on a CartAddress so that I know if a customer has selected one of the customer addresses

mutation SetCustomerShippingAddressOnCart($cartId: String!, $customerAddressId: Int!) {
  setShippingAddressesOnCart(
    input: { cart_id: $cartId, shipping_addresses: [{ customer_address_id: $customerAddressId }] }
  ) {
    cart {
      id
      __typename
      shipping_addresses {
        id
        customer_address_id
      }
      billing_address {
        id
        customer_address_id
      }
    }
  }
}

Schema

Current CartAddressInteface

Add these fields:

interface CartAddressInterface {
    id: ID!
    customer_address_id: ID @doc(description: "Reference to customer address")
}

If the CustomerAddress has implemented the uid we'd like to have customer_address_uid

github-jira-sync-bot commented 2 years ago

Unfortunately, not enough information was provided to create a Jira ticket. Please make sure you added the following label(s): Reproduced on 2.4.x, ^Area:.*

Once all required labels are present, please add Issue: Confirmed label again.

github-jira-sync-bot commented 2 years ago

Unfortunately, not enough information was provided to create a Jira ticket. Please make sure you added the following label(s): Reproduced on 2.4.x, ^Area:.*

Once all required labels are present, please add Issue: Confirmed label again.

damienwebdev commented 1 year ago

@cpartica this is a big problem.

damienwebdev commented 1 year ago

@paales @cpartica - https://github.com/graycoreio/magento2-quote-graphql-aux

paales commented 1 year ago

I've recently had a comment from @hnsr that I should write better code and is is very unclear, which I agree.

https://github.com/graphcommerce-org/graphcommerce/blob/c1bdf2fc3cbba2fa5448582c21b6aac1b18ffc28/packages/magento-cart-shipping-address/components/CustomerAddressForm/CustomerAddressForm.tsx#L39-L52

@hnsr We might be able to implement a local resolver for this in GraphCommerce and make @damienwebdev's package optional and move to a Magento native solution when it is implemented.

m2-assistant[bot] commented 1 year ago

Hi @chernenm. Thank you for working on this issue. In order to make sure that issue has enough information and ready for development, please read and check the following instruction: :point_down: