Php WooCommerce-签出期间创建帐户时出错
我正在用WooCommerce建立一个网络商店。我的地址设置如下: 1.帐单地址 2.复选框:创建帐户(未登录时) 3.复选框:发送到其他地址 因此,当客户选中“创建帐户”复选框时,他们必须填写密码。我想将帐单地址信息用于帐单和发货地址(默认情况下)。但是,当客户现在选中“创建帐户”复选框并未选中“发货至不同地址”时,表单会显示一个错误,提示客户也需要填写发货地址字段。下面是我的结帐代码(帐单地址字段和创建帐户复选框;请评论更多代码) 我希望有人能找到解决办法。谢谢Php WooCommerce-签出期间创建帐户时出错,php,wordpress,checkbox,woocommerce,webshop,Php,Wordpress,Checkbox,Woocommerce,Webshop,我正在用WooCommerce建立一个网络商店。我的地址设置如下: 1.帐单地址 2.复选框:创建帐户(未登录时) 3.复选框:发送到其他地址 因此,当客户选中“创建帐户”复选框时,他们必须填写密码。我想将帐单地址信息用于帐单和发货地址(默认情况下)。但是,当客户现在选中“创建帐户”复选框并未选中“发货至不同地址”时,表单会显示一个错误,提示客户也需要填写发货地址字段。下面是我的结帐代码(帐单地址字段和创建帐户复选框;请评论更多代码) 我希望有人能找到解决办法。谢谢 <div class=
<div class="woocommerce-billing-fields">
<?php if ( WC()->cart->ship_to_billing_address_only() && WC()->cart->needs_shipping() ) : ?>
<h2><?php _e( 'Billing & Shipping', 'woocommerce' ); ?></h2>
<?php else : ?>
<?php endif; ?>
<?php do_action( 'woocommerce_before_checkout_billing_form', $checkout ); ?>
<?php foreach ( $checkout->checkout_fields['billing'] as $key => $field ) : ?>
<?php woocommerce_form_field( $key, $field, $checkout->get_value( $key ) ); ?>
<?php endforeach; ?>
<?php do_action('woocommerce_after_checkout_billing_form', $checkout ); ?>
<?php if ( ! is_user_logged_in() && $checkout->enable_signup ) : ?>
<div class="create-account-wrapper">
<?php if ( $checkout->enable_guest_checkout ) : ?>
<p class="form-row form-row-wide create-account-title walsheim checkbox-wrapper">
<input class="input-checkbox" id="createaccount" <?php checked( ( true === $checkout->get_value( 'createaccount' ) || ( true === apply_filters( 'woocommerce_create_account_default_checked', false ) ) ), true) ?> type="checkbox" name="createaccount" value="1" /> <label for="createaccount" class="checkbox"><?php _e( 'create an account', 'woocommerce' ); ?></label>
</p>
<?php endif; ?>
<?php do_action( 'woocommerce_before_checkout_registration_form', $checkout ); ?>
<?php if ( ! empty( $checkout->checkout_fields['account'] ) ) : ?>
<div class="create-account create-account-content">
<p><?php _e( 'Create an account by entering the information below. If you are a returning customer please login at the top of the page.', 'woocommerce' ); ?></p>
<?php foreach ( $checkout->checkout_fields['account'] as $key => $field ) : ?>
<?php woocommerce_form_field( $key, $field, $checkout->get_value( $key ) ); ?>
<?php endforeach; ?>
<div class="clear"></div>
</div>
<?php endif; ?>
<?php do_action( 'woocommerce_after_checkout_registration_form', $checkout ); ?>
</div>
<?php endif; ?>
</div>
type=“checkbox”name=“createaccount”value=“1”/>
在woocoomerce
设置页面的shipping
选项卡下有一个选项,标签为shipping Destination
。尝试选择默认帐单地址
选项