form-coupon.php 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <?php
  2. /**
  3. * Checkout coupon form
  4. *
  5. * This template can be overridden by copying it to yourtheme/woocommerce/checkout/form-coupon.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.4.4
  16. */
  17. defined( 'ABSPATH' ) || exit;
  18. if ( ! wc_coupons_enabled() ) { // @codingStandardsIgnoreLine.
  19. return;
  20. }
  21. ?>
  22. <div class="woocommerce-form-coupon-toggle">
  23. <?php wc_print_notice( apply_filters( 'woocommerce_checkout_coupon_message', __( 'Have a coupon?', 'woocommerce' ) . ' <a href="#" class="showcoupon">' . __( 'Click here to enter your code', 'woocommerce' ) . '</a>' ), 'notice' ); ?>
  24. </div>
  25. <form class="checkout_coupon woocommerce-form-coupon" method="post" style="display:none">
  26. <p><?php esc_html_e( 'If you have a coupon code, please apply it below.', 'woocommerce' ); ?></p>
  27. <p class="form-row form-row-first">
  28. <input type="text" name="coupon_code" class="input-text" placeholder="<?php esc_attr_e( 'Coupon code', 'woocommerce' ); ?>" id="coupon_code" value="" />
  29. </p>
  30. <p class="form-row form-row-last">
  31. <button type="submit" class="button" name="apply_coupon" value="<?php esc_attr_e( 'Apply coupon', 'woocommerce' ); ?>"><?php esc_html_e( 'Apply coupon', 'woocommerce' ); ?></button>
  32. </p>
  33. <div class="clear"></div>
  34. </form>