"Are you sure?" popup to order cancel

  • Posts: 171
  • Thank you received: 9
9 years 4 months ago #206721

Hi!

Is there a way to add an "Are you sure?" onclick confirmation before executing the 'cancel_order' function in order/list view?
I think I should modify this line to achieve that, but I can not get it how to do that exactly:

echo $this->cart->displayButton($text,'cancel_order',$this->params,hikashop_completeLink('order&task=cancel_order&email=1&order_id='.$row->order_id.$url_itemid),'document.adminForm_'.$row->order_id.'_cancel.submit();return false;','class="hikashop_order_cancel_button"'); 

Thanks in advance,
PePe

Please Log in or Create an account to join the conversation.

  • Posts: 13201
  • Thank you received: 2322
9 years 4 months ago #206751

Hi,

You can use that code:

echo $this->cart->displayButton($text,'cancel_order',$this->params,hikashop_completeLink('order&task=cancel_order&email=1&order_id='.$row->order_id.$url_itemid),'if(confirm(\'Cancel the order ?\')){document.adminForm_'.$row->order_id.'_cancel.submit();}else{self.close();}return false;','class="hikashop_order_cancel_button"');

The following user(s) said Thank You: pepecortez

Please Log in or Create an account to join the conversation.

  • Posts: 171
  • Thank you received: 9
9 years 4 months ago #206877

Xavier wrote: Hi,

You can use that code:

echo $this->cart->displayButton($text,'cancel_order',$this->params,hikashop_completeLink('order&task=cancel_order&email=1&order_id='.$row->order_id.$url_itemid),'if(confirm(\'Cancel the order ?\')){document.adminForm_'.$row->order_id.'_cancel.submit();}else{self.close();}return false;','class="hikashop_order_cancel_button"');


Works like a charm!
Thanks Xavier!

Please Log in or Create an account to join the conversation.

Time to create page: 0.073 seconds
Powered by Kunena Forum