De pe un forum al programatorilor care se chinuie sa desluseasca tainele Magento :
The problem is, however, the function is in the wrong class (and file), and I don’t want to modify a core file. Unfortunately, my Kung Fu isn’t strong enough to get it to work without altering the core file, as I’ve been trying for a few hours.
Put this in your head section of your file :
1
2
3
4
5
6
7
| <script>
function confirmDelete(delUrl) {
if (confirm("Are you sure you want to delete")) {
document.location = delUrl;
}
}
</script> |
And further down in the page :
<a href="javascript:confirmDelete('delete.page?id=1')">Delete</a>
Another way:
<a href="delete.page?id=1&phpMyAdmin=8rAC-HitBaaKjjuJK6I5aeNI-Ea" onclick="return confirm('Are you sure you want to delete?')">
Delete
</a>