• Prior to the most recent rounds of updates to this plugin the conditional fields on this form: https://www.showlowmainstreet.org/farmers-market-and-art-walk-registration were showing properly. At the very bottom of the page, there’s 2 different submit buttons (shows based on payment method chosen). One if you choose check or walkin and a 2nd if you choose paypal (under Payment Method).

    Is there a fix for this? I’d hate to find another method to do this small task. You’re plugin is (or well was) super helpful.

    THANK YOU!

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Jules Colle

    (@jules-colle)

    looks like the scripts aren’t loaded.

    Scripts are loaded in cf7cf.php around line 314. You will find this code:

    add_action('wpcf7_contact_form', 'wpcf7cf_enqueue_scripts', 10, 1);
    function wpcf7cf_enqueue_scripts(WPCF7_ContactForm $cf7form) {
    
        if (is_admin()) return;
    
    // ... some more code here ...
    
        wp_enqueue_script('wpcf7cf-scripts', plugins_url('js/scripts.js', __FILE__), array('jquery'), WPCF7CF_VERSION, true);
        wp_localize_script('wpcf7cf-scripts', 'wpcf7cf_options_'.$wpcf7cf_global_count, $options);
    }

    Not sure how familiar you are with coding, but this line will add the script js/scripts.js to the footer of your document:

    wp_enqueue_script('wpcf7cf-scripts', plugins_url('js/scripts.js', __FILE__), array('jquery'), WPCF7CF_VERSION, true);

    In order for this to work however, you theme needs to call wp_footer(); at some point during the rendering of the page.

    First thing you should check is if your theme’s footer.php file contains a line saying:

    wp_footer();

    If it’s there, than something else might be wrong. Try and set a breakpoint at this line, or add some debugging code to see if the code is actually executed

    wp_enqueue_script('wpcf7cf-scripts', plugins_url('js/scripts.js', __FILE__), array('jquery'), WPCF7CF_VERSION, true);

    Thread Starter tammydavis7

    (@tammydavis7)

    Hi Jules,

    Thank you so much for responding! I am moderately comfortable with coding, so feel free to send additional explanations where you can.

    Here’s what I found out with your tips:
    1. The wp_footer is in the footer.php
    2. I turned on debug and had it write to the debug.log.
    Here’s the error it’s kicking out:
    PHP Notice: wpcf7_add_shortcode is deprecated since Contact Form 7 version 4.6! Use wpcf7_add_form_tag instead. in /homepages/17/d641819139/htdocs/clickandbuilds/ShowLowMainStreet/wp-content/plugins/contact-form-7/includes/functions.php on line 357
    3. I used the string locator plugin to search for wpcf7_add_shortcode to see if any plugin anywhere used it. The only file with that string in it is: wp-content/plugins/cf7-conditional-fields/readme.txt (which is simply your readme file)

    What am I missing?

    Any additional hints would be greatly appreciated!

    Thank you for your time!

    Plugin Author Jules Colle

    (@jules-colle)

    Are you sure footer.php is loaded on this page https://www.showlowmainstreet.org/farmers-market-and-art-walk-registration ?

    To test this, add some text to footer.php and see if it shows up on that page.

    Thread Starter tammydavis7

    (@tammydavis7)

    Yes, it’s is. I added #SLMS# in the footer.php right after the wp_footer call.

    You can see it here at the bottom of the page: https://www.showlowmainstreet.org/farmers-market-and-art-walk-registration

    Any other thoughts on this?

    THANK YOU SO MUCH for all of your time.

    Plugin Author Jules Colle

    (@jules-colle)

    The only other thing I can think of now is that another plugin might be destroying the ‘wpcf7cf_enqueue_scripts’ action hook

    Could you disable your plugins one by one to see which one might be interfering with my plugin?

    Thread Starter tammydavis7

    (@tammydavis7)

    Hmmm…well I disabled them one by one but no luck. The conditional fields still did not show like they should. So I’m guessing that only leaves my theme as what’s causing the issue. I use Divi from Elegant Themes so at this point I’m not willing to change that. Unless you have another suggestion I guess I’ll have to remove the conditional fields and just display everything all of the time. Thanks for all your help!

    Plugin Author Jules Colle

    (@jules-colle)

    could you email me that theme so i can check? you can find my email address in the readme.txt file

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Conditional Fields No Longer Showing’ is closed to new replies.