説明なし

form-shipping.php 2.6KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. <?php
  2. /**
  3. * Checkout shipping information form
  4. *
  5. * This template can be overridden by copying it to yourtheme/woocommerce/checkout/form-shipping.php.
  6. *
  7. * HOWEVER, on occasion WooCommerce will need to update template files and you
  8. * (the theme developer) will need to copy the new files to your theme to
  9. * maintain compatibility. We try to do this as little as possible, but it does
  10. * happen. When this occurs the version of the template file will be bumped and
  11. * the readme will list any important changes.
  12. *
  13. * @see https://docs.woocommerce.com/document/template-structure/
  14. * @package WooCommerce\Templates
  15. * @version 3.6.0
  16. * @global WC_Checkout $checkout
  17. */
  18. defined( 'ABSPATH' ) || exit;
  19. ?>
  20. <div class="woocommerce-shipping-fields">
  21. <?php if ( true === WC()->cart->needs_shipping_address() ) : ?>
  22. <h3 id="ship-to-different-address">
  23. <label class="woocommerce-form__label woocommerce-form__label-for-checkbox checkbox">
  24. <input id="ship-to-different-address-checkbox" class="woocommerce-form__input woocommerce-form__input-checkbox input-checkbox" <?php checked( apply_filters( 'woocommerce_ship_to_different_address_checked', 'shipping' === get_option( 'woocommerce_ship_to_destination' ) ? 1 : 0 ), 1 ); ?> type="checkbox" name="ship_to_different_address" value="1" /> <span><?php esc_html_e( 'Ship to a different address?', 'woocommerce' ); ?></span>
  25. </label>
  26. </h3>
  27. <div class="shipping_address">
  28. <?php do_action( 'woocommerce_before_checkout_shipping_form', $checkout ); ?>
  29. <div class="woocommerce-shipping-fields__field-wrapper">
  30. <?php
  31. $fields = $checkout->get_checkout_fields( 'shipping' );
  32. foreach ( $fields as $key => $field ) {
  33. woocommerce_form_field( $key, $field, $checkout->get_value( $key ) );
  34. }
  35. ?>
  36. </div>
  37. <?php do_action( 'woocommerce_after_checkout_shipping_form', $checkout ); ?>
  38. </div>
  39. <?php endif; ?>
  40. </div>
  41. <div class="woocommerce-additional-fields">
  42. <?php do_action( 'woocommerce_before_order_notes', $checkout ); ?>
  43. <?php if ( apply_filters( 'woocommerce_enable_order_notes_field', 'yes' === get_option( 'woocommerce_enable_order_comments', 'yes' ) ) ) : ?>
  44. <?php if ( ! WC()->cart->needs_shipping() || wc_ship_to_billing_address_only() ) : ?>
  45. <h3><?php esc_html_e( 'Additional information', 'woocommerce' ); ?></h3>
  46. <?php endif; ?>
  47. <div class="woocommerce-additional-fields__field-wrapper">
  48. <?php foreach ( $checkout->get_checkout_fields( 'order' ) as $key => $field ) : ?>
  49. <?php woocommerce_form_field( $key, $field, $checkout->get_value( $key ) ); ?>
  50. <?php endforeach; ?>
  51. </div>
  52. <?php endif; ?>
  53. <?php do_action( 'woocommerce_after_order_notes', $checkout ); ?>
  54. </div>