Skip proceed and go to checkout when appointment is confirmed

Hi, I would like to skip the proceed link and go to checkout when appointment is confirmed. I am using App+ and Marketpress. I tried the code for functions.php on this thread but it creates some weird loop effect on my side: https://premium.wpmudev.org/forums/topic/skip-straight-to-checkout-when-appointment-is-confirmed#post-961765

I have given staff access to the site in question.

  • Sajid
    • DEV MAN’s Sidekick

    Hi

    “>@jacqueskarsten,

    Hope you are doing good today :slight_smile:

    Try using following code instead and then check again.

    add_action( 'wp_footer', 'app_redirect_after_book' );
    function app_redirect_after_book() {
    ?>
    <script type="text/javascript">
    jQuery(function ($) {
    setInterval(function () {
    if ($('.app-confirmation-marketpress').size() > 0) {
    location.href = $('.app-confirmation-marketpress a').attr('href');
    }
    }, 1000)
    })
    </script>
    <?php
    }

    Hope this helps! Feel free to post a reply if you need further assistance :slight_smile:

    Cheers, Sajid

  • Sajid
    • DEV MAN’s Sidekick

    Hi @jacqueskarsten,

    Hope you are doing good today :slight_smile:

    Please add following code instead and then check again.

    add_action( 'wp_footer', 'app_redirect_after_book', 100 );
    function app_redirect_after_book() {
    ?>
    <script type="text/javascript">
    jQuery(function ($) {
    setInterval(function () {
    if ($('.app-confirmation-marketpress').size() > 0) {
    location.href = $('.app-confirmation-marketpress a').attr('href');
    }
    }, 1000)
    })
    </script>
    <?php
    }

    If its still not working then please don’t remove the code from page and post the link here so I can see what exactly the issue is.

    Take care and have a nice day :slight_smile:

    Cheers, Sajid

  • Sajid
    • DEV MAN’s Sidekick

    Hi @jacqueskarsten,

    Hope you are doing good today :slight_smile:

    Thanks for leaving the code in the page and sharing the link. Now I can understand why its causing a redirect loop.

    Please try following code instead and then check again.

    add_action( 'wp_footer', 'app_redirect_after_book', 100 );
    function app_redirect_after_book() {
    ?>
    <script type="text/javascript">
    jQuery(function ($) {
    $('.appointments-confirmation-button').click(function(){

    setInterval(function () {
    if ($('.app-confirmation-marketpress').size() > 0) {
    location.href = $('.app-confirmation-marketpress a').attr('href');
    }
    }, 70000);

    });

    })
    </script>
    <?php
    }

    Hope that helps! Feel free to post a reply if you need further assistance :slight_smile:

    Cheers, Sajid

  • Sajid
    • DEV MAN’s Sidekick

    Hi @jacqueskarsten,

    Hope you are doing good today :slight_smile:

    I am sorry to hear it still did not worked for you. Beside going back and forth please send in FTP and WordPress admin login credentials so I can make changes and test it instantly.

    Also, please mention where exactly you have added the code.

    Subject: “Attn: Sajid Javed”

    -WordPress admin username

    -WordPress admin password

    -login url

    -FTP credentials (host/username/password)

    -link back to this thread for reference

    -any other relevant urls

    Select “I have a different question” for your topic – this and the subject line ensure that it gets assigned to me

    https://premium.wpmudev.org/contact/

    Take care and have a nice day :slight_smile:

    Cheers, Sajid

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.