我试图将结帐时的帐单状态和帐单国家/地区字段包装在 div 中,但似乎不起作用。这是我的代码:
<div class="woocommerce-billing-fields__field-wrapper">
<?php
$fields = $checkout->get_checkout_fields( 'billing' );
foreach ( $fields as $key => $field ) {
if($key == 'billing_state'){
} else if($key == 'billing_country'){
} else{
woocommerce_form_field( $key, $field, $checkout->get_value( $key ) );
}
}
?>
<div class="state-province">
<?php woocommerce_form_field( "billing_state", $checkout->checkout_fields['billing']['billing_state'], $checkout->get_value( 'billing_state' ) ); ?>
<?php woocommerce_form_field( "billing_country", $checkout->checkout_fields['billing']['billing_country'], $checkout->get_value( 'billing_country' ) ); ?>
</div>
</div>
狐的传说