Appointments are not redirecting

I have appointments in a thrive theme plugin called Thrive Lightboxes so that it will be a pop up.
The page works fine until it's time for the appt plugin to redirect to the page I have set.
This is what Thrive themes said:
I checked the issue and the problem comes from the Appointments plugin. The redirect doesn’t work on the page because the Appointments plugin only adds the redirect script functionality if they detect their appointment shortcode in the content.
Since the lightboxes are added dynamically (their content is added only later in the page) the redirect script will not be added because the appointment shortcode is not detected.
is there a way around this?

  • Adam Czajczyk

    Hello MzPlatinum

    I hope you're well today and thank you for your patience.

    Below is a short code for you. Please apply it to your site as follows:

    1. Create an empty file with a .php extension (e.g. "app-popup-fix.php")
    2. Copy and paste the code to that file (using some "clean text" editor such as e.g. Notepad++, Sublime or similar)
    3. Save the file and upload it to the "/wp-content/mu-plugins" folder of your site's WordPress install (do it via FTP or e.g. cPanel "File Manager").

    <?php 
    
    function shortcode_add_app_scripts(){
    	global $appointments;
    	$appointments->load_scripts_styles( );
    }
    add_shortcode( 'app-add-scripts', 'shortcode_add_app_scripts' );

    Once it's there, please edit your popup that contains Appointments+ booking shortcodes and add this shortcode to it (anywhere, e.g. at the very end of the popup content):

    [app-add-scripts]

    then update your popup, clear all caches and give it a try.

    Since I don't have access to Thrive theme with the Thrive Lightboxes plugin, I wasn't able to check it with it but I was able to replicate the same issue with other popups and I believe that since the reason is the same, the solution should also work for you.

    Let me know please if it did.

    Best regards,
    Adam

  • MzPlatinum

    Hi Adam,
    First off, thank you so much for the help in trying to figure out a workaround.
    I'm glad it worked on your end, unfortunately for me, it did not.
    I don't have an MU Plugins folder and have read threads which suggest the folder is no longer necessary. I added the new app-popup-fix.php file to my site's "/wp-content/plugins" folder.

    After adding the additional shortcode to my popup content, this is the outcome it produced:
    https://www.screencast.com/t/2V0C0jvBqR
    and the page again did not redirect. Thank you still for your help. I await your reply.

    P.S. You should have access to the Thrive lightbox and pop up via my site since I enabled support access.

    Warmest regards,
    MzPlatinum

  • Adam Czajczyk

    Hello MzPlatinum

    Unfortunately, I don't have access to your site because there's some additional .htaccess protection which doesn't let me in even despite support access being enabled.

    However, the fact that you're seeing shortcode means that the code wasn't even executed. I'm not sure what exactly information and where did you read about mu-plugins folder but I think it might be a slight misunderstanding:

    the folder is not necessary and WordPress can easily work without it, it doesn't use any MU plugins by default but plugins such as this one are not "full featured plugins" and mu-plugins folder is still perfectly valid solution, fully supported and fully compliant with WordPress Codex.

    That being said, please try this:

    First, just go to the "Plugins -> All plugins" page and see if you can see that "app-popup-fix.php" there and if so if you can activate it; any plugins that's been added to /wp-content/plugins must be activated first.

    However, it might not work and if it doesn't, please follow my original suggestion on where to put the file: remove it from /wp-content/plugins and put into /wp-content/mu-plugins (no activation is needed in this case).

    Alternatively, you can wait for an official release because this fix has already been submitted to the code and went through initial tests. But I'm not able to give you any ETA on when the next update will be released and if that particular fix will be included in that closest update or the next one. I'd rather suggest trying what I described above then.

    If that still doesn't work, let me know please and I'll tell you how you can securely provide me with full access credentials (including FTP) so I could check it and apply the fix for you.

    Best regards,
    Adam

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.