Skip to content

Commit

Permalink
debugging shopping cart
Browse files Browse the repository at this point in the history
  • Loading branch information
nka11 committed Apr 18, 2012
1 parent 737d956 commit 0564304
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 1 deletion.
28 changes: 28 additions & 0 deletions resources/static/js/shoppingCart.js
Expand Up @@ -498,6 +498,34 @@ define('store/shoppingCart',
if (data.message) {
validation_message.empty()
.append(data.message);
if (data.type === "email") {
validation_message.append('<div> \
<div>Please enter a valid email</div> \
<div><input type="text" name="email"/>\
<button>update Email</button></div>\
</div>');
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('<div class="error">Invalid email format</div>');
}
}
});
;
});
}
validation_message.dialog({modal: true});
}
}
Expand Down
Expand Up @@ -94,7 +94,7 @@ session = karacos.serving.get_session() %>
</tbody>
</table>
<% services = store.__get_services__() %>
% if 'paypay_express' in services:
% if 'paypal_express' in services:
<div class="pay_button" typeof="karacos:method"
about="urn:uuid:k-meche_store_paypal_button:pay_cart" style="display:none;">
<div style="display:none;" property="url">{store_url}</div>
Expand Down

0 comments on commit 0564304

Please sign in to comment.