git ci fixed #507

This commit is contained in:
arzynik 2012-11-07 13:35:02 -05:00
parent 9479723459
commit eef2ef9c48
2 changed files with 8 additions and 1 deletions

View File

@ -801,7 +801,7 @@ App.cart = {
if (App.restaurant.meetDeliveryMin() && App.order.delivery_type == 'delivery') { if (App.restaurant.meetDeliveryMin() && App.order.delivery_type == 'delivery') {
$('.delivery-minimum-error').show(); $('.delivery-minimum-error').show();
$('.delivery-min-diff').html(parseFloat(App.restaurant.delivery_min - App.cart.total()).toFixed(2)); $('.delivery-min-diff').html(App.restaurant.deliveryDiff());
} else { } else {
$('.delivery-minimum-error').hide(); $('.delivery-minimum-error').hide();

View File

@ -33,6 +33,13 @@ var Restaurant = function(id) {
} }
} }
self.deliveryDiff = function() {
var total = self.delivery_min_amt == 'subtotal' ? App.cart.subtotal() : App.cart.total();
var diff = parseFloat(App.restaurant.delivery_min - total).toFixed(2);
/* console.log(App.cart.subtotal(), App.cart.total(),self.delivery_min_amt, total, diff); */
return diff;
}
self.meetDeliveryMin = function() { self.meetDeliveryMin = function() {
var total = self.delivery_min_amt == 'subtotal' ? App.cart.subtotal() : App.cart.total(); var total = self.delivery_min_amt == 'subtotal' ? App.cart.subtotal() : App.cart.total();
return total < parseFloat(self.delivery_min) ? true : false; return total < parseFloat(self.delivery_min) ? true : false;