PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

promo code

  1. steveschutte
    Member

    A beginner question, what files do I need to change to implement the promo code below?

    Form to be changed: https://aneededride.com/membership/

    Topic: http://www.gravityhelp.com/forums/topic/total-wont-update-on-gform_product_total
    Code:

    <?php
    
    add_filter( 'gform_pre_render_2', 'joe_ind_js');
    function joe_ind_js($form) {
        echo <<<END
    <script type="text/javascript">
        jQuery(document).ready(function($){
            $("#input_2_26").change(function(){
                gformCalculateTotalPrice(2);
            });
        });
        function gform_product_total( formId, total) {
            if(jQuery("#input_2_26").val().toLowerCase() == 'xyzpromo' )
                total -= 30;
            return total;
        }
    </script>
    END;
        return $form;
    }

    Thank You.

    Posted 11 years ago on Thursday January 3, 2013 | Permalink
  2. steveschutte
    Member

    Please help. I am lost. The other work around exposes the promo code. Thanks in advance for your help and patience.

    What php.file do I update?

    gform_pre_render_2 ? means form 2
    #input_2_26 ? means form 2 input 26 ?
    gformCalculateTotalPrice(2); ? means calculate form 2

    Posted 11 years ago on Monday January 7, 2013 | Permalink
  3. The only PHP file you should edit is the functions.php file in your current theme.

    gform_pre_render_2 ? means form 2: YES

    #input_2_26 ? means form 2 input 26 ?: YES

    gformCalculateTotalPrice(2); ? means calculate form 2: YES

    Posted 11 years ago on Tuesday January 8, 2013 | Permalink
  4. Additionally, Rocketgenius/Gravity Forms is working on a coupon add-on which may be able to help you with this functionality. I'm not sure what your timeline is.

    Posted 11 years ago on Tuesday January 8, 2013 | Permalink
  5. Chris, is there somewhere that I can follow the progress of the coupon add-on? I could use this on a site and was surprised to learn it didn't already exist.

    Thanks and keep up the great work!

    Posted 11 years ago on Tuesday January 15, 2013 | Permalink
  6. The best place for information is to watch the blog for announcements.

    http://www.gravityhelp.com/

    Or, sign up for email news here:
    http://feedburner.google.com/fb/a/mailverify?uri=gravityhelp/WvJm&loc=en_US

    Posted 11 years ago on Tuesday January 15, 2013 | Permalink
  7. Thanks!

    Posted 11 years ago on Tuesday January 15, 2013 | Permalink

This topic has been resolved and has been closed to new replies.