| @@ -32,8 +32,10 @@ | ||
| 32 | 32 | * Composes an object with the necessary properties to display |
| 33 | 33 | * the notification in the browser. |
| 34 | 34 | * |
| 35 | 35 | * @return null|object the notification display data payload. |
| 36 | + * | |
| 37 | + * @throws Exception | |
| 36 | 38 | */ |
| 37 | 39 | public function getData() |
| 38 | 40 | { |
| 39 | 41 | $booking_id = (int)$this->get('idorder', 0); |
| @@ -67,12 +69,9 @@ | ||
| 67 | 69 | $notif_data->title = $notif_title; |
| 68 | 70 | $notif_data->message = $this->get('content', ''); |
| 69 | 71 | $notif_data->icon = $notif_icon; |
| 70 | 72 | $notif_data->onclick = 'VBOCore.handleDisplayWidgetNotification'; |
| 71 | - $notif_data->gotourl = 'index.php?option=com_vikbooking&task=editorder&cid[]=' . $booking_id; | |
| 72 | - if (VBOPlatformDetection::isWordPress()) { | |
| 73 | - $notif_data->gotourl = str_replace('index.php', 'admin.php', $notif_data->gotourl); | |
| 74 | - } | |
| 73 | + $notif_data->gotourl = VBOFactory::getPlatform()->getUri()->admin("index.php?option=com_vikbooking&task=editorder&cid[]={$booking_id}", false); | |
| 75 | 74 | |
| 76 | 75 | // set additional properties to the notification payload related to the guest message |
| 77 | 76 | $notif_data->widget_id = 'guest_messages'; |
| 78 | 77 | $notif_data->channel = $this->get('channel', null); |
| @@ -79,8 +78,13 @@ | ||
| 79 | 78 | $notif_data->id_order = $booking_id; |
| 80 | 79 | $notif_data->id_customer = $this->get('id_customer', null); |
| 81 | 80 | $notif_data->id_message = $this->get('id_message', null); |
| 82 | 81 | $notif_data->id_thread = $this->get('id_thread', null); |
| 82 | + // set additional data options to ensure the conversation will be found | |
| 83 | + $notif_data->_options = [ | |
| 84 | + '_web' => 1, | |
| 85 | + 'bid' => $booking_id, | |
| 86 | + ]; | |
| 83 | 87 | |
| 84 | 88 | return $notif_data; |
| 85 | 89 | } |
| 86 | 90 | |