Commit ed9e5be5 authored by Mario's avatar Mario

warn about unsaved changes in checkout form

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