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

Zero Subtotal checkout with coupon value greater than cart total is not working. #16523

Closed BabliDey closed 6 years ago

BabliDey commented 6 years ago

Preconditions

  1. Magento 2.2.3
  2. 10.0.32-MariaDB-0

Steps to reproduce

  1. Added a coupon code of flat discount of 25 euro
  2. Enabled Zero Subtotal Checkout form store > configuration > sales > payment methods
  3. Added product to cart of 18 euro applied the coupon code as a whole the total amount to be paid is zero including shipping.
  4. Added shipping details and in next step the No payment method is coming.
  5. No payment required is displayed in the screen with place order button. But when clicking on Place Order showing error message The requested payment method is not available. With error in console.log for /V1/guest-carts/805fc9f9ca0925cf34f7ebc5be9f2f5c/payment-information 400 (Bad Request)

Expected result

  1. [Screenshots, logs or description] payment_page payment_process

Actual result

  1. [Screenshots, logs or description]
magento-engcom-team commented 6 years ago

Hi @BabliDey. 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-engcom-team give me {$VERSION} instance

where {$VERSION} is version tags (starting from 2.2.0+) or develop branches (2.2-develop +). For more details, please, review the Magento Contributor Assistant documentation.

@BabliDey do you confirm that you was able to reproduce the issue on vanilla Magento instance following steps to reproduce?

engcom-backlog-nickolas commented 6 years ago

@BabliDey, thank you for your report. Unfortunately I'm not able to reproduce this issue. When I try to apply coupon without 'Free Shipping', then I get this picture on checkout: screenshot_5 and I can place order without any problems.

And if I add 'Free Shipping' to rule, free shipping configuration then I get this picture: free shippng And again I can place order without any errors.

Can you please add more details or steps to reproduce?

BabliDey commented 6 years ago

What i found that it is not getting $this->getMethod() value in root\vendor\magento\module-payment\Model\Info.php in public function getMethodInstance() function.

This is the total setting of my coupon code. screencapture-blumeidealbeta-de-interbi-sales_rule-promo_quote-edit-id-29-key-ae532f2e21de9a84e1b75668d5a80a2a36ffa75575c80e9f2a47e0c361623d12-2018-07-04-16_05_37

And this is the screen shot of patment page screencapture-blumeidealbeta-de-checkout-2018-07-04-16_08_20

BabliDey commented 6 years ago

Get requst to https://www.example.de/rest/examplede/V1/guest-carts/3d167ff3baa49eb642f83c4c04cacb61/payment-information

Showing

{ "payment_methods": [ { "code": "hgwdds", "title": "SEPA Lastschrift" }, { "code": "hgwivs", "title": "Kauf auf Rechnung" }, { "code": "amazon_payment", "title": "Amazon Pay" }, { "code": "paypal_express", "title": "PayPal" }, { "code": "free", "title": "No Payment Information Required" }, { "code": "hgwcc", "title": "Kreditkarte" }, { "code": "hgwsue", "title": "Sofortüberweisung" } ], "totals": { "grand_total": 0, "base_grand_total": 0, "subtotal": 18.7, "base_subtotal": 18.7, "discount_amount": -25, "base_discount_amount": -25, "subtotal_with_discount": -6.3, "base_subtotal_with_discount": -6.3, "shipping_amount": 4.66, "base_shipping_amount": 4.66, "shipping_discount_amount": 4.99, "base_shipping_discount_amount": 4.99, "tax_amount": 0, "base_tax_amount": 0, "weee_tax_applied_amount": null, "shipping_tax_amount": 0, "base_shipping_tax_amount": 0, "subtotal_incl_tax": 20.01, "shipping_incl_tax": 4.99, "base_shipping_incl_tax": 4.99, "base_currency_code": "EUR", "quote_currency_code": "EUR", "coupon_code": "MEU9CO2MY92O ", "items_qty": 1, "items": [ { "item_id": 2982, "price": 18.7, "base_price": 18.7, "qty": 1, "row_total": 18.7, "base_row_total": 18.7, "row_total_with_discount": 0, "tax_amount": 0, "base_tax_amount": 0, "tax_percent": 7, "discount_amount": 20.01, "base_discount_amount": 20.01, "discount_percent": 0, "price_incl_tax": 20.01, "base_price_incl_tax": 20.01, "row_total_incl_tax": 20.01, "base_row_total_incl_tax": 20.01, "options": "[{\"value\":\"31.07.2018\",\"label\":\"Wunschliefertermin\"}]", "weee_tax_applied_amount": null, "weee_tax_applied": null, "name": "Joy" } ], "total_segments": [ { "code": "subtotal", "title": "Zwischensumme", "value": 20.01 }, { "code": "shipping", "title": "Versand & Bearbeitung (Lieferung zu 90% am Wunschtermin sonst am folgenden Werktag - DHL)", "value": 4.66 }, { "code": "discount", "title": "Rabatt (MEU9CO2MY92O )", "value": -25 }, { "code": "tax", "title": "Steuer", "value": 0, "extension_attributes": { "tax_grandtotal_details": [] } }, { "code": "grand_total", "title": "Gesamtsumme", "value": 0, "area": "footer" } ] } } But the post request with email: babli.citytech@gmail.com( mail used in shipping address) and paymentMethod : free showing The payment method you are looking for is not available.

BabliDey commented 6 years ago

Same issue is placed here for other version https://github.com/magento/magento2/issues/7536 And for my installation $total->setShippingDiscountAmount($address->getShippingDiscountAmount()); $total->setBaseShippingDiscountAmount($address->getBaseShippingDiscountAmount()); these two lines are already added

engcom-backlog-nickolas commented 6 years ago

@magento-engcom-team give me 2.2.3 instance

magento-engcom-team commented 6 years ago

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

magento-engcom-team commented 6 years ago

Hi @engcom-backlog-nickolas, here is your Magento instance. Admin access: https://i-16523-2-2-3.engcom.dev.magento.com/admin Login: admin Password: 123123q Instance will be terminated in up to 3 hours.

engcom-backlog-nickolas commented 6 years ago

@BabliDey, can you please reproduce this issue on clean instance mentioned above?

BabliDey commented 6 years ago

Hello @engcom-backlog-nickolas , not able to reproduce this in the fresh installation https://i-16523-2-2-3.engcom.dev.magento.com/admin.

Mine was upgraded with all the data of 2.1.8 to 2.2.3.

engcom-backlog-nickolas commented 6 years ago

@BabliDey, I've tried such steps:

  1. Install Magento 2.1.8.
  2. Create customer, product, cart price rule with coupon code and fixed discount = 25.
  3. Create simple product price = 18.
  4. Create couple orders with created product using coupon for discount.
  5. Upgrade Magento to 2.2.3.
  6. Create order with created product using coupon for discount. No errors occurred. Orders have been placed successfully, discount applied successfully.

I'm closing this issue. If you'd like to update it, please fill free to reopen it.

arteugen commented 6 years ago

Hello @BabliDey, i got also this error message with the same conditions and magento version. How could you fix this issue? Best regards, Eugen