Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

debugging shopping cart

  • Loading branch information...
commit 0564304e9b651dd99acd45eec9b7de9e292f23cc 1 parent 737d956
nka11 authored April 18, 2012
28  resources/static/js/shoppingCart.js
@@ -498,6 +498,34 @@ define('store/shoppingCart',
498 498
 									if (data.message) {
499 499
 										validation_message.empty()
500 500
 											.append(data.message);
  501
+										if (data.type === "email") {
  502
+											validation_message.append('<div> \
  503
+														<div>Please enter a valid email</div> \
  504
+														<div><input type="text" name="email"/>\
  505
+														<button>update Email</button></div>\
  506
+													</div>');
  507
+											validation_message.find("button").button().click(function(e){
  508
+												e.stopImmediatePropagation();
  509
+												e.preventDefault();
  510
+												karacos.action({
  511
+													url: '/',
  512
+													method: "set_user_email",
  513
+													params: {"email": validation_message.find("input").val()},
  514
+													async: true,
  515
+													callback: function(setEmailResult) {
  516
+														if (setEmailResult.success) {
  517
+															validation_message.dialog('destroy');
  518
+														}
  519
+													},
  520
+													error: function(setEmailError) {
  521
+														if (validation_message.find(".error").length === 0) {
  522
+															validation_message.append('<div class="error">Invalid email format</div>');
  523
+														}
  524
+													}
  525
+												});
  526
+												;
  527
+											});
  528
+										}
501 529
 										validation_message.dialog({modal: true});
502 530
 									}
503 531
 								}
2  resources/templates/default/fragments/get_shopping_cart.jst
@@ -94,7 +94,7 @@ session = karacos.serving.get_session() %>
94 94
          </tbody>
95 95
         </table>
96 96
         <% services = store.__get_services__() %>
97  
-        % if 'paypay_express' in services: 
  97
+        % if 'paypal_express' in services: 
98 98
 	        <div class="pay_button" typeof="karacos:method"
99 99
 	        about="urn:uuid:k-meche_store_paypal_button:pay_cart" style="display:none;">
100 100
 	         <div style="display:none;" property="url">{store_url}</div>

0 notes on commit 0564304

Please sign in to comment.
Something went wrong with that request. Please try again.