Okay
  Public Ticket #2709763
Autofill coupon codes on checkout page
Closed

Comments

  • Denis started the conversation

    Hi,

    Is there a way to autofill a coupon code in the checkout page, so that when somebody books an appointment, the coupon code is already applied? Looks like there is no way to pass a coupon via shortcode. Is there any other way? Using a link?

    Thanks

    Denis

  • [deleted] replied

    Hi Denis, 

    Thank you for your purchase.

    There isn't such possibility with Amelia's current built-in features, unfortunately. You can  suggest that as a feature request here, if you wish. 

    If you have any other questions or concerns feel free to open a new ticket and we will gladly help out.



  • Denis replied

    Thank you Marija.

    Is there a way to download the unminified vue.js files the frontend uses, so we can make our own code changes? Unfortunately Amelia has practically no hooks and filters for a developer to attach to and since everything frontend is done in minified JS it's almost impossible to customize functionality. This makes integrating Amelia into our custom workflow pretty much impossible. If we could get the unminified files ate least we could make changes directly. That's the last resort we have, otherwise we may not be able to use the plugin.

    Thanks

    Denis

  • [deleted] replied

    You are welcome, Denis.

    Yes, JS files are modified (minimized) in the public version of plugin, but unfortunately we can not send you our source code because that is the policy of our company.

    There are a few JS hooks which 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)


    And there are these WP hooks in Amelia, , if those could help you out somehow.

    This should be added to  "wp-content/mu-plugins/functions.php"

    <?php
    function amelia_booking_added_hook($reservation, $bookings, $container) {
    }
    add_action('AmeliaBookingAdded', 'amelia_booking_added_hook', 10, 3);
    function amelia_booking_time_updated_hook($reservation, $bookings, $container) {
    }
    add_action('AmeliaBookingTimeUpdated', 'amelia_booking_time_updated_hook', 10, 3);
    function amelia_booking_status_updated_hook($reservation, $bookings, $container) {
    }
    add_action('AmeliaBookingStatusUpdated', 'amelia_booking_status_updated_hook', 10, 3);
    function amelia_booking_canceled_hook($reservation, $bookings, $container) {
    }
    add_action('AmeliaBookingCanceled', 'amelia_booking_canceled_hook', 10, 3);
    ?>

    So, these functions will be triggered after these actions: booking, cancelling, time update, status update

    $reservation has data about the appointment (startTime, endTime...)

    $bookings contains data about the bookings that started the action (from the front-end there will be one booking, and in the back-end there can be more, if a group appointment is created)