Cart page: wrong radio button shipping method selected
-
I just encountered some strange behaviour on the cart page (using AJAX). And only when using Firefox (not tested all browsers yet).
Situation:
I have 2 shipping zones. Each zone has a local pickup option. The other option is delivery or shipping (depending on the postal code). Both methods are standard WC (local pickup and flat rate).
If I change the shipping address to another zone, the shipping cost are updated and the selected shipping method has a checked radio button. If I change the shipping method to local pickup shipping cost are updated and the local pickup method has a checked radio button. So far, so good.
When I reload the page, the selected method is still local pickup. However, the radio button for the other method (shipping or delivery) is checked. I have verified the value of $current_shipping_method (= local pickup). The total order amount is based on local pickup as well. When I inspect the HTML element, it becomes even more weird. The local pickup radio button has an attribute checked = “checked”, while the other has not.
In short, the actual shipping method is not visually checked, while the not select method is visually checked.
I have tried to rearrange the order of shipping methods in the settings of Woocommerce, but that did not change anything.
When I proceed to the checkout page, the local pickup method is checked again.
It seems to me this is not caused in the back-end (PHP), but is the result of javascript (and/or the browser).
I know there is little chance that a customer will actually experience this behaviour. After some testing, I’m only able to replicate this behaviour when logged in. On top of that I have only tested Firefox, Chrome and Edge yet. In Edge and Chrome it seems to be working fine. So this will even further reduce the chance, but I’d rather get rid of this flaw.
I’m wondering if anybody else has experienced this behaviour.
- The topic ‘Cart page: wrong radio button shipping method selected’ is closed to new replies.