/templates/checkout/form-shipping.php

  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. * @author WooThemes 
  15. * @package WooCommerce/Templates 
  16. * @version 3.0.0 
  17. */ 
  18.  
  19. if ( ! defined( 'ABSPATH' ) ) { 
  20. exit; // Exit if accessed directly 
  21.  
  22. ?> 
  23. <div class="woocommerce-shipping-fields"> 
  24. <?php if ( true === WC()->cart->needs_shipping_address() ) : ?> 
  25.  
  26. <h3 id="ship-to-different-address"> 
  27. <label class="woocommerce-form__label woocommerce-form__label-for-checkbox checkbox"> 
  28. <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 _e( 'Ship to a different address?', 'woocommerce' ); ?></span> 
  29. </label> 
  30. </h3> 
  31.  
  32. <div class="shipping_address"> 
  33.  
  34. <?php do_action( 'woocommerce_before_checkout_shipping_form', $checkout ); ?> 
  35.  
  36. <div class="woocommerce-shipping-fields__field-wrapper"> 
  37. <?php foreach ( $checkout->get_checkout_fields( 'shipping' ) as $key => $field ) : ?> 
  38. <?php woocommerce_form_field( $key, $field, $checkout->get_value( $key ) ); ?> 
  39. <?php endforeach; ?> 
  40. </div> 
  41.  
  42. <?php do_action( 'woocommerce_after_checkout_shipping_form', $checkout ); ?> 
  43.  
  44. </div> 
  45.  
  46. <?php endif; ?> 
  47. </div> 
  48. <div class="woocommerce-additional-fields"> 
  49. <?php do_action( 'woocommerce_before_order_notes', $checkout ); ?> 
  50.  
  51. <?php if ( apply_filters( 'woocommerce_enable_order_notes_field', get_option( 'woocommerce_enable_order_comments', 'yes' ) === 'yes' ) ) : ?> 
  52.  
  53. <?php if ( ! WC()->cart->needs_shipping() || wc_ship_to_billing_address_only() ) : ?> 
  54.  
  55. <h3><?php _e( 'Additional information', 'woocommerce' ); ?></h3> 
  56.  
  57. <?php endif; ?> 
  58.  
  59. <div class="woocommerce-additional-fields__field-wrapper"> 
  60. <?php foreach ( $checkout->get_checkout_fields( 'order' ) as $key => $field ) : ?> 
  61. <?php woocommerce_form_field( $key, $field, $checkout->get_value( $key ) ); ?> 
  62. <?php endforeach; ?> 
  63. </div> 
  64.  
  65. <?php endif; ?> 
  66.  
  67. <?php do_action( 'woocommerce_after_order_notes', $checkout ); ?> 
  68. </div> 
.