English (United Kingdom)
Knowledge Base  >  Vik Appointments  >  Hooks  >  Site Pages  >  Order  >  Display Service Summary

apply_filters( 'vikappointments_display_order_service_summary', string $html, string $location, object $event, object $order )

Fires while displaying the details of the booked service.


Description

Trigger hook to let the plugins add custom HTML contents within the appointment block. This hook fires several times, once for each supported location. This procedure repeats up to the number of booked services.

Our VikAppointments - Zoom plugin uses this hook to display the button to start the meeting through the Zoom app.

The following image indicates where the resulting HTML can be appended.


Parameters

$html

(string)  The HTML to include.

$location

(string)  The position in which the HTML code will be placed.

  • before - before the appointment box;
  • top - at the beginning of the appointment box;
  • appointment - after the main appointment details (below the service);
  • options - after the list of the purchased options;
  • notes - before the box containing the user notes;
  • bottom - at the end of the appointment box;
  • after - after the appointment box.
$event

(object)  The object holding the appointment details.

$order

(VAPOrderAppointment)  The instance holding the order details.


Example

/**
 * Trigger hook to let the plugins add custom HTML contents within the block of the booked service.
 *
 * @param  string  $html      The HTML string to include within the document.
 * @param  string  $location  The HTML will be always placed after the specified location (added @since 1.2).
 * @param  object  $event     The appointment details (changed from array @since 1.2).
 * @param  object  $order     The purchased order (changed from array @since 1.2).
 */
add_filter('vikappointments_display_order_service_summary', function($html, $location, $event, $order)
{
    if ($location == 'appointment')
    {
        // append custom HTML after the service details
        $html .= '<code>HTML CODE WILL BE ADDED HERE</code>';   
    }

    return $html;
}, 10, 4);

Changelog

Version Description
1.2.0 Added $location argument to check in which position the HTML is going to be included.
The $event and $order arguments are now objects.
1.1.8 Introduced.
Last Update: 2021-07-30
Helpful?

This website uses cookies

This website uses cookies and similar technologies. Some of these technologies are necessary for the proper functioning of the website (Essential). Other technologies are used to evaluate user behavior (Analysis), to integrate external media or for advertising purposes. If you agree, these technologies are activated. For details, please refer to the privacy policy. From this same page you can also update/revoke your consent. If you do not give your consent, only cookies with essential functions will be activated.

We use technologies from the USA on our website. If you give your consent, you therefore consent at the same time to your data being transferred to the USA. We would like to point out that the USA does not have a level of data protection comparable to that of the EU and that any US company can be obliged by state authorities to hand over your data without you having any effective legal protection against this.