- Posts: 48
- Thank you received: 1
Confirmation before address delete?
11 years 8 months ago #188026
by Llarian
Confirmation before address delete? was created by Llarian
-- HikaShop version -- : 2.3.5
-- Joomla version -- : 2.5.28
-- PHP version -- : 5.4.36
I realize you can only do so much to protect your users from themselves, but I can see this causing problems.
In the address management (and shipping/billing address checkout workflow pages), there is a delete icon next to the address. If the user clicks that, their address is immediately deleted without any confirmation.
Is there any easy way to add a confirmation step to the address delete button?
-- Joomla version -- : 2.5.28
-- PHP version -- : 5.4.36
I realize you can only do so much to protect your users from themselves, but I can see this causing problems.
In the address management (and shipping/billing address checkout workflow pages), there is a delete icon next to the address. If the user clicks that, their address is immediately deleted without any confirmation.
Is there any easy way to add a confirmation step to the address delete button?
Please Log in or Create an account to join the conversation.
11 years 8 months ago - 11 years 8 months ago #188057
by nicolas
Replied by nicolas on topic Confirmation before address delete?
Hi,
Try to change the line:
to:
in the file "address_view" of the view "checkout" via the menu Display>Views and that should add it on the checkout.
For the address manager area, change the code:
to:
in the file "listing" of the view "address" via the menu Display>Views and that should do it.
Try to change the line:
Code:
<a title="<?php echo JText::_('HIKA_DELETE'); ?>" class="hikashop_checkout_<?php echo $this->type;?>_address_delete" href="<?php echo hikashop_completeLink('checkout&step='.$this->step.'&redirect=checkout&task=deleteaddress&address_id='.$address->address_id.'&'.hikashop_getFormToken().'=1'.$this->url_itemid);?>"><img alt="<?php echo JText::_('HIKA_DELETE'); ?>" src="<?php echo HIKASHOP_IMAGES; ?>delete.png" border="0" /></a>
Code:
<a onclick="if(!confirm('<?php echo JText::_('HIKASHOP_CONFIRM_DELETE_ADDRESS', true); ?>')){return false;}else{return true;}" title="<?php echo JText::_('HIKA_DELETE'); ?>" class="hikashop_checkout_<?php echo $this->type;?>_address_delete" href="<?php echo hikashop_completeLink('checkout&step='.$this->step.'&redirect=checkout&task=deleteaddress&address_id='.$address->address_id.'&'.hikashop_getFormToken().'=1'.$this->url_itemid);?>"><img alt="<?php echo JText::_('HIKA_DELETE'); ?>" src="<?php echo HIKASHOP_IMAGES; ?>delete.png" border="0" /></a>
For the address manager area, change the code:
Code:
<a href="<?php echo hikashop_completeLink('address&task=delete&address_id='.$address->address_id.'&'.$token.'=1&Itemid='.$Itemid);?>" title="<?php echo JText::_('HIKA_DELETE'); ?>"><img src="<?php echo HIKASHOP_IMAGES; ?>delete.png" alt="<?php echo JText::_('HIKA_DELETE'); ?>" /></a>
Code:
<a onclick="if(!confirm('<?php echo JText::_('HIKASHOP_CONFIRM_DELETE_ADDRESS', true); ?>')){return false;}else{return true;}" href="<?php echo hikashop_completeLink('address&task=delete&address_id='.$address->address_id.'&'.$token.'=1&Itemid='.$Itemid);?>" title="<?php echo JText::_('HIKA_DELETE'); ?>"><img src="<?php echo HIKASHOP_IMAGES; ?>delete.png" alt="<?php echo JText::_('HIKA_DELETE'); ?>" /></a>
Last edit: 11 years 8 months ago by nicolas.
Please Log in or Create an account to join the conversation.
11 years 8 months ago #188059
by Llarian
Replied by Llarian on topic Confirmation before address delete?
replace "eturn false;" with "return false;" and this works perfectly. 
Thank you!
Thank you!
Please Log in or Create an account to join the conversation.
11 years 8 months ago #188065
by nicolas
Replied by nicolas on topic Confirmation before address delete?
Thanks, I've updated the code
Please Log in or Create an account to join the conversation.
Time to create page: 0.175 seconds