countries->get_states( $country_code ); if ( ( 'billing_state' === $key || 'shipping_state' === $key ) && ( ! is_array( $states ) || empty( $states ) ) ) { return $args; } $args['class'][] = 'sellkit-checkout-field-select'; return $args; } /** * Customized html per field. * * @param string $field field html string. * @param array $args checkout fields options. * @param string $key key of field. * @return void * @since 1.1.0 */ public function field( $field, $args, $key ) { echo ''; if ( 'shipping_country' === $key || 'billing_country' === $key ) { $default = ''; if ( array_key_exists( 'default', $args ) ) { $default = $args['default']; } $this->woocommerce_field_country( $key, $default ); return; } if ( 'shipping_state' === $key || 'billing_state' === $key ) { $country_code = filter_input( INPUT_COOKIE, 'sellkit-checkout-shipping-cc' ); if ( 'billing_state' === $key ) { $country_code = filter_input( INPUT_COOKIE, 'sellkit-checkout-billing-cc' ); } if ( empty( $country_code ) ) { $country_code = 'US'; } $states = WC()->countries->get_states( $country_code ); $this->woocommerce_field_state( $key, $args, $states ); return; } $placeholder = $this->placeholder_required_value( $args ); ?>

countries->get_shipping_countries(); if ( 'billing_country' === $key ) { $countries = WC()->countries->get_allowed_countries(); } $field = ''; $field .= ''; echo $field; ?>

placeholder_required_value( $args ); ?>

', esc_attr( $placeholder ), esc_attr__( 'State', 'sellkit' ), esc_attr( 'sellkit-' . $key ), esc_attr( $state ) ); return; } $field = ''; echo $field; ?>