Magento2: Checkbox IDs for Terms and Conditions should be unique in Checkout

Created on 17 Aug 2016  路  14Comments  路  Source: magento/magento2

Magento_CheckoutAgreements places checkboxes into checkout to accept the respective terms and conditions. However, the html tag for the checkbox appears for each payment method with the same html id. It is bad practice to have the same html id multiple times and also introduces problems with css customization for these boxes which relies on unique ids.

Preconditions

  1. Install Magento 2.1

    Steps to reproduce

  2. Create a Term and Condition under Stores -> Terms and Conditions

  3. Activate Terms and Conditions under Stores -> SALES -> Checkout -> Enable Terms and Conditions
  4. Enable a second payment method e.g. Bank Transfer Payment
  5. Got through checkout process to Review & Payment
  6. Inspect HTML of checkbox tag for configured term

    Expected result

  7. Each input field of type checkbox should have a unique html id

    Actual result

  8. HTML contains 2 input fields of type checkbox with same id agreement_1

auswahl_006

Checkout Fixed in 2.1.x Fixed in 2.2.x Format is valid Ready for Work 2.1 bug report

All 14 comments

Here is an example of customized checkboxes: http://fiddle.jshell.net/78n9pr65/
This demonstrates, that the second is not useable, if input id appears more than once.
With unique ids it works perfectly well.

Thank you for reporting the issue. Our internal on is MAGETWO-61048.

Solved in 2.1.4 EE?

What kind of support is this?

2.1.5 and this bug still exists...

Just checked, this Issue is still present in latest develop branch.
auswahl_102

There are 4 matches for agreement_1, and html id="agreement_1" is appearing twice in my test case.

Closing, as issue is fixed in develop branch with the linked commits.

@ishakhsuvarov, I hate to underline the obvious, but if the bug was discovered on 2.1.x and then reportedly "fixed", it is commonly expected to see that fix in the closest patch (2.1.x) release.

To be honest, I don't see how is "merged to develop branch" an acceptable resolution to an acknowledged bug. Until the fix is officially released, a lot of the users are still struggling with it.
In my opinion, having these patches added into the nearest 2.1.x (or 2.1.x.x) releases right away would be perfect, but that doesn't seem to be happening, so...

Could you please at least include a short piece of information that will explain to an ordinary merchant, how he\she can benefit from such s fix?
Something along the following lines (not sure which of these is recommended by Magento, Inc.):

  • patch the core files according to the commits referenced (make sure to backup the patch files and re-apply them every time you update the Magento to the next released version)
  • fork the repository, and cherry-pick these commits into your local 2.1 branch and use that instead of a downloaded or composer-installed version (Although I believe this was not officially recommended if you don't plan to contribute to the project)
  • the option above plus make a pull request pointing back into 2.1-develop
  • write a module that'll do these changes "the right way" using all those shiny extends and overrides and plugins and observers and so on in order to avoid patching the core directly

Keeping the issue open until the fix appears in a 2.1.x release is also a feasible option.

Keeping the issue open until the fix appears in a 2.1.x release is also a feasible option.

@korostii Reopening, thank you for pointing out my mistake.

No problem, keep up the good work!

Internal ticket to track issue progress: MAGETWO-69379

I still encounter this issue in 2.1.10. How should I solve this?

I have tried to apply #13543 and #6207 patch file for fixing the terms and conditions issue in web shop. Still I'm facing issue.

Steps to reproduce:

  1. Enable check money order and Paypal

  2. In checkout page check the check/money order payment method checkbox and go to Paypal payment method then hit the place order button. The expected behavior should be throw the validation message in Paypal payment section while hitting the place order button. Here it's allowing to proceed the payment.
    Kindly do the needful. It's pretty urgent.

Hi @bka. Thank you for your report.
The issue has been fixed in magento/magento2#13543 by @hostep in 2.1-develop branch
Related commit(s):

The fix will be available with the upcoming 2.1.13 release.

Was this page helpful?
0 / 5 - 0 ratings