public function onDisplayTakeawayAddItemOverlay( object $item, array &$scripts ) : string

Fires after displaying the details of an item within a popup/overlay.


Description

Trigger hook to let the plugins add custom HTML contents below the take-away item overlay.

The returned HTML will be always displayed after the default contents of the page.


Parameters

$item

(object)  The object holding the take-away item details.

&$scripts

(array)  Extra javascript scripts can be attached here to benefit of the existing protected functions.

Return Value

String. The HTML to include.


Example

/**
 * Trigger event to let the plugins add custom HTML contents at the end
 * of the take-away add item overlay.
 *
 * @param   object    $item      The object holding the item details.
 * @param   string[]  &$scripts  Extra scripts to attach.
 *
 * @return  string  The HTML string to include within the document.
 */
public function onDisplayTakeawayAddItemOverlay($item, &$scripts)
{
    // attach script here
    $scripts[] = "console.log('Script fired!');";

    // append custom HTML
    return '<code>HTML CODE WILL BE ADDED HERE</code>';
}

Changelog

Version Description
1.11.2 Introduced.
Last Update: 2 days ago.
Helpful?