snave07

form-shipping.php

Oct 13th, 2019
501
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.77 KB | None | 0 0
  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. */
  17.  
  18. defined( 'ABSPATH' ) || exit;
  19.  
  20. ?>
  21. <div class="woocommerce-shipping-fields clearfix">
  22. <?php if ( true === WC()->cart->needs_shipping_address() ) : ?>
  23.  
  24. <h2 id="ship-to-different-address-title">
  25. <span class="light"><?php _e( 'Different address?', 'thegem' ); ?></span>
  26. </h2>
  27.  
  28. <p id="ship-to-different-address" class="form-row">
  29. <input id="ship-to-different-address-checkbox" class="input-checkbox gem-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" />
  30. <label for="ship-to-different-address-checkbox" class="checkbox"><?php _e( 'Ship to a different address?', 'woocommerce' ); ?></label>
  31. </p>
  32.  
  33. <div class="shipping_address">
  34.  
  35. <?php do_action( 'woocommerce_before_checkout_shipping_form', $checkout ); ?>
  36.  
  37. <div class="woocommerce-shipping-fields__field-wrapper">
  38. <?php
  39. $fields = $checkout->get_checkout_fields( 'shipping' );
  40.  
  41. foreach ( $fields as $key => $field ) {
  42. woocommerce_form_field( $key, $field, $checkout->get_value( $key ) );
  43. }
  44. ?>
  45. </div>
  46.  
  47. <?php do_action( 'woocommerce_after_checkout_shipping_form', $checkout ); ?>
  48.  
  49. </div>
  50.  
  51. <?php endif; ?>
  52. </div>
  53. <div class="woocommerce-additional-fields">
  54. <?php do_action( 'woocommerce_before_order_notes', $checkout ); ?>
  55.  
  56. <?php if ( apply_filters( 'woocommerce_enable_order_notes_field', get_option( 'woocommerce_enable_order_comments', 'yes' ) === 'yes' ) ) : ?>
  57.  
  58. <?php if ( ! WC()->cart->needs_shipping() || wc_ship_to_billing_address_only() ) : ?>
  59.  
  60. <h2><span class="light"><?php esc_html_e( 'Additional information', 'woocommerce' ); ?></span></h2>
  61.  
  62. <?php endif; ?>
  63.  
  64. <div class="woocommerce-additional-fields__field-wrapper">
  65. <?php foreach ( $checkout->get_checkout_fields( 'order' ) as $key => $field ) : ?>
  66. <?php woocommerce_form_field( $key, $field, $checkout->get_value( $key ) ); ?>
  67. <?php endforeach; ?>
  68. </div>
  69.  
  70. <?php endif; ?>
  71.  
  72. <?php do_action( 'woocommerce_after_order_notes', $checkout ); ?>
  73. </div>
Advertisement
Add Comment
Please, Sign In to add comment