Custom coding coupon code field / form
-
Hi, I have used this function and it works very well, but I also use the Cartflows plugin, normally this function works fine but not on the checkout page in Cartflows plugin, so can you teach me how I can do this, please thank you.
if ( ! defined( ‘ABSPATH’ ) ) {
exit; // Exit if accessed directly.
}
/**
* Shortcode to enter gift code
*/
function fgc_gift_claim_form() {if ( function_exists( ‘wc_coupons_enabled’ ) && wc_coupons_enabled() ) { ?>
<form class=”woocommerce-cart-form” action=”<?php echo ( home_url( ‘/checkout-woo’ ) ); ?>” method=”post”>
<div class=”actions”>
<div class=”coupon”>
<label for=”coupon_code”><?php esc_html_e( ”, ‘wc-fgc-coupon-redemption’ ); ?></label>
<input type=”text” name=”coupon_code” class=”input-text” id=”coupon_code” value=”” placeholder=”<?php esc_attr_e( ‘Coupon code’, ‘wc-fgc-coupon-redemption’ ); ?>” />
<button type=”submit” class=”button” name=”apply_coupon” value=”<?php esc_attr_e( ‘Claim free gift’, ‘wc-fgc-coupon-redemption’ ); ?>”><?php esc_attr_e( ‘Claim Free Gift’, ‘wc-fgc-coupon-redemption’ ); ?></button>
<?php do_action( ‘woocommerce_cart_coupon’ ); ?>
</div>
</div>
</form><?php } ?>
<?php
}
add_shortcode( ‘fgc_form’, ‘fgc_gift_claim_form’ );
- The topic ‘Custom coding coupon code field / form’ is closed to new replies.