checkout/form-coupon.php
- Use no-js class to hide JS only forms/content - Other changes in syntax Reference: 9b6f3f6f9b1a299157c4b5ba3b31843fc78b8d08
This commit is contained in:
parent
ce9f8dc8bd
commit
c02c44cf4e
|
@ -11,26 +11,24 @@
|
|||
* the readme will list any important changes.
|
||||
*
|
||||
* @see https://docs.woocommerce.com/document/template-structure/
|
||||
* @author WooThemes
|
||||
* @package WooCommerce/Templates
|
||||
* @version 3.3.0
|
||||
* @version 3.4.0
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit; // Exit if accessed directly.
|
||||
}
|
||||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
if ( ! wc_coupons_enabled() ) {
|
||||
if ( ! wc_coupons_enabled() || ! empty( WC()->cart->applied_coupons ) ) { // @codingStandardsIgnoreLine.
|
||||
return;
|
||||
}
|
||||
|
||||
if ( empty( WC()->cart->applied_coupons ) ) {
|
||||
$info_message = apply_filters( 'woocommerce_checkout_coupon_message', __( 'Have a coupon?', 'understrap' ) . ' <a href="#" class="showcoupon">' . __( 'Click here to enter your code', 'understrap' ) . '</a>' );
|
||||
wc_print_notice( $info_message, 'notice' );
|
||||
}
|
||||
?>
|
||||
<div class="woocommerce-form-coupon-toggle">
|
||||
<?php wc_print_notice( apply_filters( 'woocommerce_checkout_coupon_message', __( 'Have a coupon?', 'understrap' ) . ' <a href="#" class="showcoupon">' . __( 'Click here to enter your code', 'understrap' ) . '</a>' ), 'notice' ); ?>
|
||||
</div>
|
||||
|
||||
<form class="checkout_coupon" method="post" style="display:none">
|
||||
<form class="checkout_coupon woocommerce-form-coupon" method="post" style="display:none">
|
||||
|
||||
<p><?php esc_html_e( 'If you have a coupon code, please apply it below.', 'understrap' ); ?></p>
|
||||
|
||||
<p class="form-row form-row-first">
|
||||
<input type="text" name="coupon_code" class="form-control" placeholder="<?php esc_attr_e( 'Coupon code', 'understrap' ); ?>" id="coupon_code" value="" />
|
||||
|
|
Reference in New Issue