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.5k stars 9.3k forks source link

ShippingCartAddress available_shipping_methods wrong amount (shopping cart rules do not applied) #31489

Closed OleksiyOleksiyovych closed 2 years ago

OleksiyOleksiyovych commented 3 years ago

Precondition:

Steps to reproduce

  1. mutation createEmptyCart

  2. mutation addSimpleProductsToCart

    
    addSimpleProductsToCart(
    input: {
      cart_id: <CART_ID>
      cart_items: [
        {
          data: {
            quantity: 2
            sku: "24-MB04"
          }
        }
      ]
    }
    ) {...}
3. mutation setShippingAddressesOnCart

setShippingAddressesOnCart( input: { cart_id: shipping_addresses: [ { address: { firstname: "Bob" lastname: "Roll" company: "Magento" street: ["Magento Pkwy", "Main Street"] city: "Austin" region: "TX" postcode: "78758" country_code: "US" telephone: "8675309" save_in_address_book: false } } ] } ) {...} }


4. Get available shipping methods list 

query cart(cart_id: ) { shipping_addresses { available_shipping_methods { available carrier_code carrier_title error_message method_code method_title amount { currency value } price_excl_tax { value currency } price_incl_tax { value currency } } } }


### Expected result
The shipping amount for "Table Rate" method should be $0 as on Luma theme
![Shopping-Cart](https://user-images.githubusercontent.com/3465267/103316700-f4739300-4a31-11eb-9230-31f5eef27830.png)

### Actual result
"Table Rate" method amount is $15
![Desktop-screenshot](https://user-images.githubusercontent.com/3465267/103316744-1ff67d80-4a32-11eb-83ed-750c0a50dedd.png)

### Possible fix
It works well for me when I add row:

$address = $cart->getShippingAddress();


before line https://github.com/magento/magento2/blob/2.4-develop/app/code/Magento/QuoteGraphQl/Model/Resolver/ShippingAddress/AvailableShippingMethods.php#L74
m2-assistant[bot] commented 3 years ago

Hi @OleksiyOleksiyovych. 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

KrishnaK-Z commented 3 years ago

@magento I am working on this

cpartica commented 3 years ago

@KrishnaK-Z @OleksiyOleksiyovych I tried to reproduce this on 2.4.1 and on 2.4-develop and I couldn't. What version did you used when reporting this? Can you see if it's still reproducible?

bgorski commented 3 years ago

@magento give me 2.4.1 instance

magento-deployment-service[bot] commented 3 years ago

Hi @bgorski. Thank you for your request. I'm working on Magento instance for you.

magento-deployment-service[bot] commented 3 years ago

Hi @bgorski, unfortunately there is no ability to deploy Magento instance at the moment. Please try again later.

rahulbarot commented 2 years ago

@magento give me 2.4.3-p2 instance

magento-deployment-service[bot] commented 2 years ago

Hi @rahulbarot. Thank you for your request. I'm working on Magento instance for you.

magento-deployment-service[bot] commented 2 years ago

Hi @rahulbarot, unfortunately there is no ability to deploy Magento instance at the moment. Please try again later.

m2-assistant[bot] commented 2 years ago

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:

engcom-Bravo commented 2 years ago

@magento give me 2.4-develop instance

magento-deployment-service[bot] commented 2 years ago

Hi @engcom-Bravo. Thank you for your request. I'm working on Magento instance for you.

magento-deployment-service[bot] commented 2 years ago

Hi @engcom-Bravo, here is your Magento Instance: https://cd7c003d22f7a8a3b64a2a5fb001f48f.instances.magento-community.engineering Admin access: https://cd7c003d22f7a8a3b64a2a5fb001f48f.instances.magento-community.engineering/admin_2f13 Login: 8cc19490 Password: 4c8b49460629

engcom-Bravo commented 2 years ago

Hi @OleksiyOleksiyovych,

Thank you for reporting and collaboration. Verified the issue on Magento 2.4-develop branch but could not able to reproduce the issue.

Kindly refer the screenshots.

1.Cart Price Rule "Spend $50 or more - shipping is free!" is active.

venkat 5

2.Shipping Methods(Free shipping and Table Rate) are Enabled.

venkat venkat 2

3.Added the Product above $50

venkat 3

Please apply Discount coupon for free shipping. Kindly refer screenshots

venkat 4

Let us Know we have miss anything.

Thanks.

engcom-Bravo commented 2 years ago

Hi @OleksiyOleksiyovych,

We have noticed that this issue has not been updated for a period of 14 Days. Hence we assume that this issue is fixed now, so we are closing it. Please raise a fresh ticket or reopen this ticket if you need more assistance on this.

Thanks.