Skip to content

Commit

Permalink
Improvement: Add results array (condition ids) to button template for…
Browse files Browse the repository at this point in the history
… better understanding #807
  • Loading branch information
georgmaisser committed Jan 18, 2025
1 parent f38dabb commit 2ac9de1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion classes/booking_bookit.php
Original file line number Diff line number Diff line change
Expand Up @@ -173,14 +173,16 @@ public static function render_bookit_template_data(
if ($showprepagemodal) {
// We render the button only from the highest relevant blocking condition.

$data = new prepagemodal(
$data = (array)new prepagemodal(
$settings, // We pass on the optionid.
count($prepages), // The total number of pre booking pages.
$buttoncondition, // This is the button we need to render twice.
!$justmyalert ? $extrabuttoncondition : '', // There might be a second button to render.
$userid, // The userid for which all this will be rendered.
);

$data['results'] = json_encode(array_keys($results));

$datas[] = $data;

$viewparam = booking::get_value_of_json_by_key($settings->bookingid, 'viewparam');
Expand Down
2 changes: 1 addition & 1 deletion templates/bookit_price.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
<div class="w-100 d-flex justify-content-center booking-button-area"
data-itemid="{{itemid}}"
data-area="{{area}}"

data-results="{{results}}"
{{#dataaction}}data-action="{{dataaction}}"{{/dataaction}} >
{{#top}}
<div class="booking-button-toparea mb-2 {{class}}" role="{{role}}">
Expand Down

0 comments on commit 2ac9de1

Please sign in to comment.