Evolve Web Hosting Posted August 6, 2021 Share Posted August 6, 2021 Hoping someone can help me create a hook to display the cancellation reason in the client area. Using SIX template now with the hopes of switching to Twenty One real soon. 0 Quote Link to comment Share on other sites More sharing options...
string Posted August 6, 2021 Share Posted August 6, 2021 Following hook should do the trick: <?php add_hook('ClientAreaProductDetailsOutput', 1, function($service) { if (!empty($service['service']->cancellationRequests['0']['reason'])) { $cancellationReason = htmlspecialchars ($service['service']->cancellationRequests['0']['reason'], ENT_QUOTES); return " <script> var cancellationReason = new DOMParser().parseFromString('{$cancellationReason}', 'text/html'); jQuery('#alertPendingCancellation').append(`<br />Reason: \${cancellationReason.documentElement.textContent}`); </script> "; } }); Save that under "/includes/hooks/<a_filename>.php" to activate. 0 Quote Link to comment Share on other sites More sharing options...
Evolve Web Hosting Posted August 6, 2021 Author Share Posted August 6, 2021 @string that's perfect! Thank you! 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.