I try to auto-expand the coupon field on the WooCommerce checkout page. By default, the customer has to click "Do you have a coupon? Click here!". But we would like to have that field always visible. I tried with js but it is not working. However, I would like to have a pure PHP approach if this is possible.
add_action( 'wp_footer', 'woocommerce_show_coupon', 99 );
function woocommerce_show_coupon() {
echo '
<script type="text/javascript">
jQuery(document).ready(function($) {
$('.checkout_coupon').show();
});
</script>
';
}
Does someone have an idea how I can do that in a smart way?
Cheers
2
Answers
You can overridden by copying it to yourtheme/woocommerce/checkout/form-coupon.php the code below: