From 0564304e9b651dd99acd45eec9b7de9e292f23cc Mon Sep 17 00:00:00 2001 From: nka11 Date: Wed, 18 Apr 2012 08:36:08 +0200 Subject: [PATCH] debugging shopping cart --- resources/static/js/shoppingCart.js | 28 +++++++++++++++++++ .../default/fragments/get_shopping_cart.jst | 2 +- 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/resources/static/js/shoppingCart.js b/resources/static/js/shoppingCart.js index aa8924d..513d67b 100644 --- a/resources/static/js/shoppingCart.js +++ b/resources/static/js/shoppingCart.js @@ -498,6 +498,34 @@ define('store/shoppingCart', if (data.message) { validation_message.empty() .append(data.message); + if (data.type === "email") { + validation_message.append('
\ +
Please enter a valid email
\ +
\ +
\ +
'); + validation_message.find("button").button().click(function(e){ + e.stopImmediatePropagation(); + e.preventDefault(); + karacos.action({ + url: '/', + method: "set_user_email", + params: {"email": validation_message.find("input").val()}, + async: true, + callback: function(setEmailResult) { + if (setEmailResult.success) { + validation_message.dialog('destroy'); + } + }, + error: function(setEmailError) { + if (validation_message.find(".error").length === 0) { + validation_message.append('
Invalid email format
'); + } + } + }); + ; + }); + } validation_message.dialog({modal: true}); } } diff --git a/resources/templates/default/fragments/get_shopping_cart.jst b/resources/templates/default/fragments/get_shopping_cart.jst index 948fdde..649e90e 100644 --- a/resources/templates/default/fragments/get_shopping_cart.jst +++ b/resources/templates/default/fragments/get_shopping_cart.jst @@ -94,7 +94,7 @@ session = karacos.serving.get_session() %> <% services = store.__get_services__() %> - % if 'paypay_express' in services: + % if 'paypal_express' in services: