Commit ed9e5be5 authored by Mario's avatar Mario

warn about unsaved changes in checkout form

parent dfbe8eaf
......@@ -6,59 +6,66 @@
<h3>{{if $title}}{{$title}}{{else}}Order{{/if}}</h3>
</div>
<div class="section-content-wrapper">
<table class="w-100">
<tr>
<th width=10%>Qty</th>
<th width=50%>Description</th>
<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>
{{if $order_checkedout}}
{{$item.item_qty}}
{{else}}
<input class="form-control form-control-sm" type="text" name="qty-{{$item.id}}" value="{{$item.item_qty}}" style="min-width: 4em;">
{{/if}}
</td>
<td>{{$item.item_desc}}</td>
<td style="text-align:right;">{{$item.item_price}}</td>
<td style="text-align:right;">{{$item.extended}}</td>
</tr>
{{/foreach}}
<tr>
<td colspan=4>
{{if !$order_checkedout}}
<button class="btn btn-outline-success btn-sm" type="submit" name="Submit" title="Update Cart">Update</button>
<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>
<th width=50%>Description</th>
<th width=20% style="text-align:right;">Price each {{if $currencysymbol}}({{$currencysymbol}}){{/if}}</th>
<th width=20% style="text-align:right;">Extended</th>
</tr>
{{foreach $items as $item}}
<tr>
<td>
{{if $order_checkedout}}
{{$item.item_qty}}
{{else}}
<input class="form-control form-control-sm" type="text" name="qty-{{$item.id}}" value="{{$item.item_qty}}" style="min-width: 4em;">
{{/if}}
</td>
</tr>
</form>
<tr>
<td></td><td></td>
<th style="text-align:right;">Subtotal</th>
<td style="text-align:right;">{{$totals.Subtotal}}</td>
</tr>
<tr>
<td></td><td></td>
<th style="text-align:right;">Tax Total</th>
<td style="text-align:right;">{{$totals.Tax}}</td>
</tr>
<tr>
<td></td><td></td>
<th style="text-align:right;">Order Total</th>
<td style="text-align:right;">{{$totals.OrderTotal}}</td>
</tr>
{{if $totals.Payment}}
<tr>
<td></td>
<th>Payment</th>
<td style="text-align:right;">{{$totals.Payment}}</td>
</tr>
{{/if}}
</table>
</td>
<td>{{$item.item_desc}}</td>
<td style="text-align:right;">{{$item.item_price}}</td>
<td style="text-align:right;">{{$item.extended}}</td>
</tr>
{{/foreach}}
<tr>
<td colspan=4>
{{if !$order_checkedout}}
<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>
<tr>
<td></td><td></td>
<th style="text-align:right;">Subtotal</th>
<td style="text-align:right;">{{$totals.Subtotal}}</td>
</tr>
<tr>
<td></td><td></td>
<th style="text-align:right;">Tax Total</th>
<td style="text-align:right;">{{$totals.Tax}}</td>
</tr>
<tr>
<td></td><td></td>
<th style="text-align:right;">Order Total</th>
<td style="text-align:right;">{{$totals.OrderTotal}}</td>
</tr>
{{if $totals.Payment}}
<tr>
<td></td>
<th>Payment</th>
<td style="text-align:right;">{{$totals.Payment}}</td>
</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