form-checkout.php 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. <?php
  2. /**
  3. * Checkout Form
  4. *
  5. * This template can be overridden by copying it to yourtheme/woocommerce/checkout/form-checkout.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 2.3.0
  17. */
  18. if ( ! defined( 'ABSPATH' ) ) {
  19. exit;
  20. }
  21. wc_print_notices();
  22. do_action( 'woocommerce_before_checkout_form', $checkout );
  23. // If checkout registration is disabled and not logged in, the user cannot checkout
  24. if ( ! $checkout->is_registration_enabled() && $checkout->is_registration_required() && ! is_user_logged_in() ) {
  25. echo apply_filters( 'woocommerce_checkout_must_be_logged_in_message', __( 'You must be logged in to checkout.', 'woocommerce' ) );
  26. return;
  27. }
  28. ?>
  29. <form name="checkout" method="post" class="checkout woocommerce-checkout" action="<?php echo esc_url( wc_get_checkout_url() ); ?>" enctype="multipart/form-data">
  30. <?php if ( $checkout->get_checkout_fields() ) : ?>
  31. <?php do_action( 'woocommerce_checkout_before_customer_details' ); ?>
  32. <div class="col2-set" id="customer_details">
  33. <div class="col-1">
  34. <?php do_action( 'woocommerce_checkout_billing' ); ?>
  35. </div>
  36. <div class="col-2">
  37. <?php do_action( 'woocommerce_checkout_shipping' ); ?>
  38. </div>
  39. </div>
  40. <?php do_action( 'woocommerce_checkout_after_customer_details' ); ?>
  41. <?php endif; ?>
  42. <h3 id="order_review_heading"><?php _e( 'Your order', 'woocommerce' ); ?></h3>
  43. <?php do_action( 'woocommerce_checkout_before_order_review' ); ?>
  44. <div id="order_review" class="woocommerce-checkout-review-order">
  45. <?php do_action( 'woocommerce_checkout_order_review' ); ?>
  46. </div>
  47. <?php do_action( 'woocommerce_checkout_after_order_review' ); ?>
  48. </form>
  49. <?php do_action( 'woocommerce_after_checkout_form', $checkout ); ?>