-
AuthorPosts
-
May 22, 2019 at 3:49 pm #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 formfunction 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
LyseMay 25, 2019 at 9:23 pm #1104207Hey 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'); });
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 -
AuthorPosts
- You must be logged in to reply to this topic.