Title: Custom coding coupon code field / form
Last modified: November 18, 2021

---

# Custom coding coupon code field / form

 *  Resolved [Tony](https://wordpress.org/support/users/frfvipy/)
 * (@frfvipy)
 * [4 years, 6 months ago](https://wordpress.org/support/topic/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’ );

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Plugin Support [CartFlows Team](https://wordpress.org/support/users/cartflows/)
 * (@cartflows)
 * [4 years, 6 months ago](https://wordpress.org/support/topic/custom-coding-coupon-code-field-form/#post-15103509)
 * Hello [@frfvipy](https://wordpress.org/support/users/frfvipy/)
 * Thank you for getting in touch with us!
 * It seems that you are trying to create a shortcode to add on the CartFlows page
   to display the custom coupon form.
 * With reference to the code that you have shared, the shortcode that you have 
   created is ‘fgc_form’. So, you need to add/place the [fgc_form] on the CartFlows
   Checkout page just above the CartFlows Checkout form to display the custom coupon
   form.
 * I hope this helps you.
 * Feel free to get in touch with us in case you have more questions.
 *  Plugin Support [CartFlows Team](https://wordpress.org/support/users/cartflows/)
 * (@cartflows)
 * [4 years, 5 months ago](https://wordpress.org/support/topic/custom-coding-coupon-code-field-form/#post-15203731)
 * Hello [@frfvipy](https://wordpress.org/support/users/frfvipy/)
 * Thank you for getting in touch with us!
 * This is to let you know that we haven’t heard back from you in a while so marking
   this thread as resolved considering the issue is solved.
 * If you still having the issue then feel free to open a new support thread or 
   you can open a [technical support ticket](https://cartflows.com/support/) from
   the website.
 * Happy to help.
 * Have a good day and stay safe.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Custom coding coupon code field / form’ is closed to new replies.

 * ![](https://ps.w.org/cartflows/assets/icon-256x256.gif?rev=3298049)
 * [CartFlows – Funnel Builder & Checkout Plugin for WooCommerce](https://wordpress.org/plugins/cartflows/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/cartflows/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/cartflows/)
 * [Active Topics](https://wordpress.org/support/plugin/cartflows/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/cartflows/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/cartflows/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [CartFlows Team](https://wordpress.org/support/users/cartflows/)
 * Last activity: [4 years, 5 months ago](https://wordpress.org/support/topic/custom-coding-coupon-code-field-form/#post-15203731)
 * Status: resolved