PluginProbe
VikBooking Hotel Booking Engine & PMS / 1.8.16
VikBooking Hotel Booking Engine & PMS v1.8.16
1.8.16 1.8.15 1.8.14 1.8.13 1.8.12 1.8.11 1.8.10 1.8.9 1.8.6 1.8.7 1.8.8 trunk 1.6.0 1.6.1 1.6.2 1.6.3 1.6.4 1.6.5 1.6.6 1.6.7 1.6.8 1.6.9 1.7.0 1.7.1 1.7.2 All 37 releases
← All changes | site/views/oconfirm/view.html.php +27 -2 1.6.4 → 1.8.16 View file →
@@ -454,13 +454,30 @@
454 454 if ($couponroomok !== true) {
455 455 $coupon = [];
456 456 VikError::raiseWarning('', JText::translate('VBCOUPONINVROOM'));
457 457 }
458 +
459 + /**
460 + * Trigger event to allow third-party plugins to implement additional coupon validations or manipulation.
461 + *
462 + * @since 1.16.7 (J) - 1.6.7 (WP)
463 + */
464 + if ($couponroomok) {
465 + $coupon_validation = VBOFactory::getPlatform()->getDispatcher()->filter('onValidateCouponCode', [&$coupon]);
466 + if (is_array($coupon_validation) && in_array(false, $coupon_validation, true)) {
467 + // coupon is not valid, errors should be set by the plugin's hook
468 + $coupon = [];
469 + }
470 + }
471 +
458 472 } else {
459 473 $coupon = [];
460 474 VikError::raiseWarning('', JText::translate('VBCOUPONINVDATES'));
461 475 }
462 476 } else {
477 + if (!$valid_customer_coupon) {
478 + $coupon = [];
479 + }
463 480 VikError::raiseWarning('', JText::translate('VBCOUPONNOTFOUND'));
464 481 }
465 482 }
466 483
@@ -513,9 +530,9 @@
513 530 $proomindex = [];
514 531 }
515 532 $this->roomindex = $proomindex;
516 533
517 - // push data to tracker
534 + // push initial data to tracker
518 535 $rooms_ids = [];
519 536 $prices_ids = [];
520 537 foreach ($rooms as $ir => $r) {
521 538 $rooms_ids[$ir] = $r['id'];
@@ -520,9 +537,17 @@
520 537 foreach ($rooms as $ir => $r) {
521 538 $rooms_ids[$ir] = $r['id'];
522 539 $prices_ids[$ir] = $prices[$ir];
523 540 }
524 - VikBooking::getTracker()->pushDates($pcheckin, $pcheckout, $daysdiff)->pushParty($arrpeople)->pushRooms($rooms_ids, $prices_ids, $proomindex)->closeTrack();
541 + VikBooking::getTracker()
542 + ->pushDates($pcheckin, $pcheckout, $daysdiff)
543 + ->pushParty($arrpeople)
544 + ->pushRooms($rooms_ids, $prices_ids, $proomindex);
525 545
546 + // display the View
526 547 parent::display($tpl);
548 +
549 + // close tracking
550 + VikBooking::getTracker()
551 + ->closeTrack();
527 552 }
528 553 }