snave07

form-coupon.php

Oct 13th, 2019
132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.94 KB | None | 0 0
  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.  
  18. defined( 'ABSPATH' ) || exit;
  19.  
  20. if ( ! wc_coupons_enabled() ) { // @codingStandardsIgnoreLine.
  21. return;
  22. }
  23.  
  24. $thegem_checkout_type = thegem_get_option('checkout_type', 'multi-step');
  25.  
  26. if ( empty( WC()->cart->applied_coupons ) ) {
  27. $info_message = apply_filters( 'woocommerce_checkout_coupon_message', __( 'Have a coupon?', 'woocommerce' ) . ' <a href="#" class="showcoupon">' . __( 'Click here to enter your code', 'woocommerce' ) . '</a>' );
  28. if ($thegem_checkout_type == 'multi-step') {
  29. echo '<div class="checkout-notice checkout-coupon-notice">' . $info_message . '</div>';
  30. }
  31. if ($thegem_checkout_type == 'one-page') {
  32. echo '<div class="checkout-notice checkout-coupon-notice">' . $info_message . '</div>';
  33. }
  34. }
  35. ?>
  36.  
  37. <form class="checkout_coupon woocommerce-form-coupon" method="post" style="display:none">
  38. <input type="text" name="coupon_code" class="input-text coupon-code" placeholder="<?php esc_attr_e( 'Coupon code', 'woocommerce' ); ?>" id="coupon_code" value="" />
  39. <?php
  40. thegem_button(array(
  41. 'tag' => 'button',
  42. 'text' => esc_html__( 'Apply coupon', 'woocommerce' ),
  43. 'style' => 'outline',
  44. 'size' => 'small',
  45. 'attributes' => array(
  46. 'name' => 'apply_coupon',
  47. 'value' => esc_attr__( 'Apply coupon', 'woocommerce' ),
  48. 'type' => 'submit',
  49. )
  50. ), true);
  51. ?>
  52. </form>
Advertisement
Add Comment
Please, Sign In to add comment