Duplicate #place_order buttons in classic checkout
-
I have identified a HTML standards compliance issue in this WooCommerce PayPal plugin which is preventing this plugin from playing nicely with other plugins or JavaScript components on the checkout page.
The PayPal plugin appears to be creating a clone of the
<button#place_order>
at the time of the page loading and merely adding few classes to the cloned button. The cloned button is placed inside a<div#ppcp-hosted-fields>
container, the problem being that the button’s ID is not changed, resulting in duplicate buttons with the same ID.According to HTML standards, each ID must be unique within a document. The presence of duplicate IDs causes issues with other JavaScript functionalities, particularly those that manipulate or interact with the checkout button based on its ID. For instance, other plugins attempting to modify the checkout button text based on the selected payment method fail to properly identify the correct button due to these duplicated IDs. This just being one example of many potentially unforeseen issues.
If the PayPal plugin is going to clone elements then make sure that it changes the ID to something unique.
- You must be logged in to reply to this topic.