Override the confirmation popup using formConfirm hook

When i am creating a confirmation popup using formConfirm hook then the confirmation popup is showing but it’s not overriding the default confirmation popup that means first the default confirmation popup is coming then my modified confirmation popup. How to stop default confirmation popup and show only my confirmation popup using hook?

Hello,

Buy using my free module Remove confirmation Pop-up ?

Hi @ksar thanks for your reply. I have seen your post before also downloaded your module and using it. Actually you are redirecting the url using js but i want to stay on the same page and want to override the default pop.

My scenario is if user will try to delete any line item then one popup will show with product name that you are going to delete this. So i am using your module’s hook to show in every page where the line item is present but right now two popup is opening one is default then mine or if use different hook that is “formObjectOptions” then mine is coming first then default one also if i will use your hook “formConfirm” then it’s not satisfying the if condition and not getting executed because of this condtion.

if (! $formconfirm) {
$parameters = array(‘lineid’ => $lineid);
$reshook = $hookmanager->executeHooks(‘formConfirm’, $parameters, $object, $action); // Note that $action and $object may have been modified by hook
if (empty($reshook)) $formconfirm.=$hookmanager->resPrint;
elseif ($reshook > 0) $formconfirm=$hookmanager->resPrint;
}