Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #1103368

    Hi
    I use the Wholesale Lead Capture plugin and on the wholesale registration form I use the following code snippet to:
    // Change the default country on Wholesale registration form

    function wwsSetRegistrationDefaultCountry() {
     
        if ( is_page( 'wholesale-registration' ) ) {
            ?>
     
            <script type="text/javascript">
                jQuery(document).ready(function () {
                    jQuery('select#wwlc_country').val('CA');
                    jQuery('select#wwlc_country').trigger('chosen:updated');
                    jQuery('select#wwlc_country').trigger('change');
                });
            </script>
     
            <?php
        }
     
    }
     
    add_action( 'wp_footer', 'wwsSetRegistrationDefaultCountry' );

    I’ve been working with the Wholesale plugin tier level for a few weeks to help my find why this snippet has stopped working. By activating the default Twenty Ninteen WordPress theme the results on the form work as expected. When the Enfold theme is activated, the code snippet no longer seems to work.

    I have included temporary login credentials below to allow you to test it out and expedite finding a resolution. As an administrator you will have to view the form in a private window to see it. That’s how it’s designed to work if your role is not a wholesaler.

    There were two updates to the Enfold theme since this code was working, so perhaps you can find what may have caused this issue.

    Thanks
    Lyse

    #1104207

    Hey tremblayly,
    Sorry for the late reply, I took a look at your form but didn’t find any errors that may cause this issue.
    I recommend disabling your cache plugin and autoptimize and the theme’s js merging, perhaps other plugins for a clean test.
    I tested your script on my localhost with the contact form which had a drop-down box and it worked good:

    jQuery(document).ready(function () {
        jQuery('#avia_4_2').val('500-1000');
        jQuery('#avia_4_2').trigger('chosen:updated');
        jQuery('#avia_4_2').trigger('change');
    });

    2019-05-25-150813
    So I believe that your code should work fine with the current Enfold, I also note that when your page loads the “#wwlc_country” drop-down is activated so your script is targeting it and is trying to run. But without any error feedback it’s hard to say what is going wrong.
    The only other thing I see is your autoptimize is triggering “Predictive Search — DEBUG” in the console, perhaps this “debug” is causing the issue, I don’t know.
    Hopefully, this helps some.

    Best regards,
    Mike

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.