Commit ed9e5be5 authored by Mario's avatar Mario

warn about unsaved changes in checkout form

parent dfbe8eaf
......@@ -6,6 +6,8 @@
<h3>{{if $title}}{{$title}}{{else}}Order{{/if}}</h3>
</div>
<div class="section-content-wrapper">
<form id="cart_form" method="post">
<input type="hidden" name="cart_posthook" value="update_item">
<table class="w-100">
<tr>
<th width=10%>Qty</th>
......@@ -13,8 +15,6 @@
<th width=20% style="text-align:right;">Price each {{if $currencysymbol}}({{$currencysymbol}}){{/if}}</th>
<th width=20% style="text-align:right;">Extended</th>
</tr>
<form method="post">
<input type="hidden" name="cart_posthook" value="update_item">
{{foreach $items as $item}}
<tr>
<td>
......@@ -32,11 +32,11 @@
<tr>
<td colspan=4>
{{if !$order_checkedout}}
<button class="btn btn-outline-success btn-sm" type="submit" name="Submit" title="Update Cart">Update</button>
<button id="cart_update" class="btn btn-success btn-sm invisible" type="submit" name="Submit" title="Update Cart"><i class="fa fa-check"></i> Save Changes</button>
{{/if}}
</td>
</tr>
</form>
<tr>
<td></td><td></td>
<th style="text-align:right;">Subtotal</th>
......@@ -60,5 +60,12 @@
</tr>
{{/if}}
</table>
</form>
<script>
$('#cart_form').areYouSure({'addRemoveFieldsMarksDirty':true, 'message': aStr['leavethispage'] });
$('#cart_form').on('dirty.areYouSure', function() {
$('#cart_update').removeClass('invisible');
});
</script>
</div>
<!-- basic_checkout_*.tpl -->
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment