Okay
  Public Ticket #2559886
Auto redirection after booking
Closed

Comments

  •  9
    Jrm57 started the conversation

    Hey, 

    I would to get an auto redirection once the booking is done without force the customer to click on « finish ».

    How can I do this ? And is it possible to redirect to different page in fonction of the kind of reservation ?


    thank you

  • [deleted] replied

    Hello,

    Thank you for getting in touch.

    Please try to change this option in Amelia General Settings:

    2124874208.png


  • [deleted] replied

    In addition to my previous response, we have some JS hooks, that are triggered depending on the view:

    window.beforeAddToCalendarLoaded()
    window.beforeBookingLoaded()
    window.beforeSearchLoaded()
    window.beforeSearchFiltered()
    window.afterSearchFiltered()
    window.beforeConfirmedBooking()
    window.beforeCatalogLoaded()
    window.afterSelectCatalogCategory(object_category)
    window.beforeCatalogCategoryLoaded(object_category)
    window.beforeCatalogServiceLoaded(object_category, object_service)
    window.afterSearchActivateService(object_appointment, object_serviceActive)
    window.afterSearchGoToSecondStep(object_appointment, object_serviceActive)
    window.afterBookingSelectDateAndTime(object_appointment, object_serviceId, object_providerId, object_locationId)
    window.afterBookingSelectService(object_appointment, object_serviceId, object_providerId, object_locationId)
    window.beforeConfirmBookingLoaded(object_appointment, object_service, object_provider, object_location)
    window.afterConfirmBooking(object_appointment, object_service, object_provider, object_location)

     

    You can use the hook, for example, beforeConfirmedBooking, that will be triggered when your customers confirm booking. You will of course set the redirect URL that you want in the script:

    <script>
    window.beforeConfirmedBooking = function()
    {
    window.location.href = "https://www.google.com";
    };
    </script>

    And you need to just place this script on the page where you have your Amelia shortode. 

    Hope this helps!

    In Amelia, if WooCommerce is enabled every booking process goes to the WooCommerce cart/checkout pages. So, if you want to set the payment method to be on-site if price of service is 0 in Amelia you can achieve that by editing one table in the database. If you need that, of course.

    When you go to your database you need to find and open the wp-options table (it can have different prefix depending on your database) , and find the option amelia_settings in it. Then please edit this option and when you find property 'wc:' there you need to set true for the 'onSiteIfFree' parameter instead of false, like here: 

     "wc": {        "onSiteIfFree": true,
    }

    Let me know if this helped!


  • Jörgen Isberg replied

    Great!

    This script solved my problem, many thanks!

    <script>
    window.beforeConfirmedBooking = function()
    {
    window.location.href = "https://www.google.com";
    };
    </script>


  •  9
    Jrm57 replied

    Ok, thank you. But where do I find this JS hooks please ? 

    I already set the url when an appointment is tooken. But the customer have to click on « finish » to see this page. I would like to make it redirect automatically instead.

  • [deleted] replied

    Hello,

    You cannot see the JS hooks in Amelia's code because it is minified. Since the files are minified, it's better to use the list I shared. You would need to define the method in regards to the hook you plan to use.

    Please take a look at this ticket: https://tmsplugins.ticksy.com/ticket/2278713/

    This customer shared a script for redirection and Google Analytics. 

    If you still need some further assistance please let us know.

  •  9
    Jrm57 replied

    Sorry but it’s too complicated for me. I don’t understand very well english and this process. Someone can help me ?

  •  2,572
    Aleksandar replied

    Hello again Jeremy

    You can add the script, mentioned before, on the page:

    <script>
    window.beforeConfirmedBooking = function()
    {
    window.location.href = "https://www.google.com";
    };
    </script>

    That will force the redirection after your customers confirm their booking, and before you get to the Congratulations screen. We've added Google.com just for example, but you can change it to the URL you want it to be.

    Kind Regards, 

    Aleksandar Vuković
    [email protected]

    Rate my support

    wpDataTables: FAQ | Facebook | Twitter | InstagramFront-end and back-end demo | Docs

    Amelia: FAQ | Facebook | Twitter | InstagramAmelia demo sites | Docs | Discord Community

    You can try wpDataTables add-ons before purchasing on these sandbox sites:

    Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables