Open DuckThom opened 1 year ago
Hi @DuckThom. Thank you for your report. To speed up processing of this issue, make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, Add a comment to the issue:
@magento give me 2.4-develop instance
- upcoming 2.4.x release@magento I am working on this
Join Magento Community Engineering Slack and ask your questions in #github channel. :warning: According to the Magento Contribution requirements, all issues must go through the Community Contributions Triage process. Community Contributions Triage is a public meeting. :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, join the Community Contributions Triage session to discuss the appropriate ticket.
Hi @engcom-Bravo. 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:
Area: XXXXX
label to the ticket, indicating the functional areas it may be related to.2.4-develop
branch@magento give me 2.4-develop instance
to deploy test instance on Magento infrastructure. 2.4-develop
branch, please, add the label Reproduced on 2.4.x
.Issue: Confirmed
once verification is complete. Hi @DuckThom,
Thank you for reporting and collaboration.
Verified the issue on Magento 2.4-develop instance and the issue is reproducible.Kindly refer the screenshots.
Steps to reproduce
As per Description.
We have added different shipping and billing address still we are getting same_as_billing: 1
. in quote address.
Hence Confirming the issue.
Thanks.
:white_check_mark: Jira issue https://jira.corp.adobe.com/browse/AC-8599 is successfully created for this GitHub issue.
:white_check_mark: Confirmed by @engcom-Bravo. Thank you for verifying the issue.
Issue Available: @engcom-Bravo, You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself.
hi @engcom-Bravo @DuckThom
Upon careful examination, it has come to my attention that there is a discrepancy between the flow of calling GraphQL and the vanilla frontend flow. This misalignment raises concerns as it deviates from the recommended and optimal approach for invoking APIs.
To illustrate this point, let's consider the scenario within Magento frontend:
At this stage, if an attempt is made to log in using an existing customer account, Magento will redirect the user back to the shipping address page. Consequently, the user will need to re-enter both the shipping and billing addresses. Based on these observations, it is my opinion that the current flow of calling GraphQL is suboptimal. I would appreciate it if you could kindly correct me if my understanding is incorrect or if there are additional factors that should be taken into consideration.
@magento I am working on this
@engcom-Bravo I am not working on this as I described above, you can remove me from this issue
@magento I am working on this
@DuckThom , @engcom-Bravo ,
@DuckThom , as per your steps, the issue is reproducible. After assigning the guest cart to customer cart, Card_Id is changing, so we need to update the shipping address and billing address to reflect in order. Not only in GraphQl , it was changing even in Luma frontend.
Steps to follow:
Create Empty cart
mutation {
createEmptyCart
}
Add Product to the above cart id
mutation {
addProductsToCart(cartId: "{cart id}", cartItems: { sku: "24-MB04", quantity: 4 }) {
cart {
id
}
}
}
Create a customer
mutation {
createCustomerV2(input: { firstname: "foo1", lastname: "bar", email: "foobar1@example.com", password: "foobar@123" }) {
customer {
firstname
lastname
}
}
}
Generate token
mutation GenerateCustomerToken {
generateCustomerToken(password: "foobar@123", email: "foobar1@example.com") {
token
}
}
Assign Guest cart to Customer
mutation {
assignCustomerToGuestCart(cart_id: "{cart id}") {
id
}
}
Here we get different card id, use this hereafter
Set Shipping Address
mutation {
setShippingAddressesOnCart(
input: {
cart_id: "{new cart id}"
shipping_addresses: [
{
address: {
firstname: "foo"
lastname: "bar"
telephone: "0987654321"
street: ["Foobar 12"]
region: "Groningen"
postcode: "1234"
city: "Groningen",
country_code: "NL",
save_in_address_book: true
}
}
]
}
) {
cart {
id
}
}
}
Set Billing Address
mutation {
setBillingAddressOnCart(
input: {
cart_id: "{new cart id}"
billing_address: {
address: {
firstname: "bar"
lastname: "foo"
telephone: "0987654321"
street: ["Wefwef 94"]
region: "Groningen"
postcode: "9876"
city: "Groningen"
country_code: "NL"
save_in_address_book: true
}
same_as_shipping: false
}
}
) {
cart {
id
}
}
}
Set Shipping Method
mutation {
setShippingMethodsOnCart(input: {
cart_id: "{new cart id}"
shipping_methods: [
{
carrier_code: "freeshipping"
method_code: "freeshipping"
}
]
}) {
cart {
shipping_addresses {
selected_shipping_method {
carrier_code
method_code
carrier_title
method_title
}
}
}
}
}
Add payment Method
mutation {
setPaymentMethodOnCart(input: {
cart_id: "{new cart id}"
payment_method: {
code: "checkmo"
}
}) {
cart {
selected_payment_method {
code
}
}
}
}
Place Order
mutation {
placeOrder(input: {cart_id: "{new cart id}"}) {
order {
order_number
}
}
}
After Placing Order, we can see in Order View Page, Shipping and Billing Address are different.
The issue - exists: Reproduced: by opening any frontend product or category page. Frontend: PWA Studio v14.0.0
./var/log/exception.log <==
[2024-05-13T19:37:12.902586+00:00] report.ERROR: Infinite loop detected, review the trace for the looping path
GraphQL (2:3)
1: mutation createCart {
2: cartId: createEmptyCart
^
3: }
{"exception":"[object] (GraphQL\\Error\\Error(code: 0): Infinite loop detected, review the trace for the looping path at ./vendor/webonyx/graphql-php/src/Error/Error.php:155)
[previous exception] [object] (LogicException(code: 0): Infinite loop detected, review the trace for the looping path at ./vendor/magento/module-checkout/Model/Session.php:254)"} []
GraphQL (2:3)
1: mutation createCart {
2: cartId: createEmptyCart
^
3: }
{"exception":"[object] (GraphQL\\Error\\Error(code: 0): The quote can't be created. at ./vendor/webonyx/graphql-php/src/Error/Error.php:155)
[previous exception] [object] (Magento\\Framework\\Exception\\CouldNotSaveException(code: 0): The quote can't be created. at ./vendor/magento/module-quote/Model/QuoteManagement.php:293)"} []
Config -> "core_config_data" path: "checkout/options/guest_checkout" is 0
Thank you
Preconditions and environment
Steps to reproduce
save_in_address_book: true
on the cartsave_in_address_book: true
on the cartmutation($cartId: String!) { assignCustomerToGuestCart(cart_id: $cartId) { id } }
After placing the order, both the shipping and billing addresses are added to the customer's address book.
Actual result
Before placing the order, the following query shows
same_as_billing: 1
after theassignCustomerToGuestCart
mutation for the shipping address:After placing the order, only the billing addresses is added to the customer's address book.
Additional information
A workaround for the issue for now it to call
setShippingAddressOnCart
a second time after theassignCustomerToGuestCart
mutationRelease note
No response
Triage and priority