• Resolved Tony

    (@frfvipy)


    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

    (@cartflows)

    Hello @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

    (@cartflows)

    Hello @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 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.