From 1d23b806e54b33584e55b82faa069a0931f53792 Mon Sep 17 00:00:00 2001 From: Douglas Hall Date: Thu, 2 Jun 2016 10:51:54 -0400 Subject: [PATCH] Fix JQuery data attribute type conversion bug for shopping cart --- lms/templates/shoppingcart/shopping_cart.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lms/templates/shoppingcart/shopping_cart.html b/lms/templates/shoppingcart/shopping_cart.html index 4f29e9017f..257cf1a532 100644 --- a/lms/templates/shoppingcart/shopping_cart.html +++ b/lms/templates/shoppingcart/shopping_cart.html @@ -372,14 +372,14 @@ from openedx.core.lib.courses import course_image_url var newQty = parseInt(newQty); var unit_cost = parseFloat(unit_cost); - return (( newQty - prevQty ) * unit_cost + prevTotal) + return (( newQty - prevQty ) * unit_cost + parseFloat(prevTotal)); } function update_user_cart(ItemId, newQty, prevQty, unit_cost, wasbusinessType, isbusinessType){ var post_url = "${reverse('shoppingcart.views.update_user_cart')}"; var typeChanged = false; - var prevTotal = $('#total-amount').data('amount') + var prevTotal = $('#total-amount').data('amount'); var newTotal = getNewTotal(prevQty, newQty, unit_cost, prevTotal); $('#total-amount').html('$'+newTotal.toFixed(2)+' USD'); $('#total-amount').data('amount', newTotal);