Support » Plugin: WooCommerce » Problem with woocommerce_available_payment_gateways hook

  • Hello,
    I’m using woocommerce_available_payment_gateways hook to enable COD gateway only when user use coupon code in the checkout page.
    I’ve wrote a simple condition for that but it can be reproduced for example on a product quantity which inscrease from 1 to 2.
    It’s working well, the COD gateway showing at the right moment, but I have a problem with the COD gateway checkbox : in the source code (inspector) the checkbox is checked but in the CSS (what I really see at front office) it’s the checkbox of the previous payement gateway which was selected, because a CSS rule on the input:checked state.
    I don’t understand why it’s happening because the page reload, so the CSS will do the same and target the right input (COD)
    I don’t think it’s a session problem, maybe JavaScript Sync.

    I would appreciate any advice or help.

  • The topic ‘Problem with woocommerce_available_payment_gateways hook’ is closed to new replies.