Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/270.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/wordpress/11.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
将信息保存在form-billing.php中_Php_Wordpress_Woocommerce - Fatal编程技术网

将信息保存在form-billing.php中

将信息保存在form-billing.php中,php,wordpress,woocommerce,Php,Wordpress,Woocommerce,我修改了form-billing.php文件,问题是该文件没有保存信息的按钮。 这是密码 <div class="woocommerce-billing-fields"> <?php if ( wc_ship_to_billing_address_only() && WC()->cart->needs_shipping() ) : ?> <h1><?php _e( 'Billing &amp; Shippi

我修改了form-billing.php文件,问题是该文件没有保存信息的按钮。 这是密码

<div class="woocommerce-billing-fields">
  <?php if ( wc_ship_to_billing_address_only() && WC()->cart->needs_shipping() ) : ?>
    <h1><?php _e( 'Billing &amp; Shipping', 'woocommerce' ); ?></h1>
  <?php else : ?>
    <h1><?php _e( 'New Customer', 'woocommerce' ); ?></h1>
  <?php endif; ?>

  <?php do_action( 'woocommerce_before_checkout_billing_form', $checkout ); ?>
  <?php foreach ( $checkout->checkout_fields['billing'] as $key => $field ): 
    if($key == 'billing_first_name' )
      woocommerce_form_field( 'billing_first_name', $field, $checkout->get_value( $key )); 

    if($key == 'billing_last_name' )
      woocommerce_form_field( 'billing_last_name', $field, $checkout->get_value( $key ));

    if($key == 'billing_company' ) 
     woocommerce_form_field( 'billing_company', $field, $checkout->get_value( $key ));

    if($key == 'billing_email' ) 
     woocommerce_form_field( 'billing_email', $field, $checkout->get_value( $key )); 
   endforeach; ?>

  <?php if ( ! is_user_logged_in() && $checkout->enable_signup ) : ?>
    <?php if ( $checkout->enable_guest_checkout ) : ?>
      <p class="form-row form-row-wide create-account create-account-paradise">
        <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">
        <?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 ); ?>
  <?php endif; ?>

  <h1><?php _e( 'Billing Address', 'woocommerce' ); ?></h1>

  <?php foreach ( $checkout->checkout_fields['billing'] as $key => $field ):
    if($key == 'billing_address_1' ) 
      woocommerce_form_field( 'billing_address_1', $field, $checkout->get_value( $key ));
    if($key == 'billing_address_2' )  
      woocommerce_form_field( 'billing_address_2', $field, $checkout->get_value( $key ));
    if($key == 'billing_phone' )  
      woocommerce_form_field( 'billing_phone', $field, $checkout->get_value( $key ));
    if($key == 'billing_city' )  
      woocommerce_form_field( 'billing_city', $field, $checkout->get_value( $key ));
    if($key == 'billing_country' )  
      woocommerce_form_field( 'billing_country', $field, $checkout->get_value( $key ));
    if($key == 'billing_state' ) 
      woocommerce_form_field( 'billing_state', $field, $checkout->get_value( $key ));
    // if($key == 'billing_postcode' ) 
    //  woocommerce_form_field( 'billing_postcode', $field, $checkout->get_value( $key ));
  endforeach; ?>

  <?php do_action('woocommerce_after_checkout_billing_form', $checkout ); ?>

</div>

type=“checkbox”name=“createaccount”value=“1”/>

在这种情况下,我有新客户的信息和帐单地址的信息,但我在保存数据方面有问题

我试着把它放在一个表单中,用一个按钮像这样保存

<form method="post">

   lines of form-billing.php

    <div class="col-xs-12">
      <input type="submit" class="button" name="save_address" value="<?php esc_attr_e( 'Save Address', 'woocommerce' ); ?>" />
      <?php wp_nonce_field( 'woocommerce-edit_address' ); ?>
      <input type="hidden" name="action" value="edit_address" />
    </div>
 </div>
</form>

表单行-billing.php

我也有同样的问题!!!