caboose-store 0.0.14 → 0.0.15
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
NDM5ZTA5YWU5NTc4NjAwOTA1NzE3Y2E4ZGIyNDFhMDZjNWRiYmYyMA==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
NzFkMGQxNDFlNTljMmIwYmNiOWYwZTMzMDM3NDY0NjA3MTE1YzlhYg==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
MWYzZDU0NzQ1NzJkOGRmMTJhZjhmYWI5OTIzNWViOTU3MDNkODA2NDIwZWM4
|
10
|
+
NjBlNDZiOGZlM2FlYjUwNGZkY2E2NjBjNDgxY2YzZGQxYTdlYmRmYzIxMTAz
|
11
|
+
ZDE4OGNiMWQ1YjAwYWMwMWJmMzY5M2YwZjgwMjA3OGQyZDA1N2Q=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
NTcxOTllMGZjOTY3ZjExZjkyNWE1YWJmZmMyNWI4MzkyNWUxMzU4ZjMyYzk2
|
14
|
+
ZTMzNWUyOGYwNjc3YTY5N2Y0ZGIwOWFmODZhY2M0N2MzNzI5OWYwNzQ5NDRj
|
15
|
+
MDM4OWY2NTY5NWM4MjVmZWQ5MjI2MjI5YjE2ODU0YWY1YmM1MjM=
|
@@ -36,16 +36,15 @@ Caboose.Store.Modules.CheckoutStep1 = (function() {
|
|
36
36
|
//
|
37
37
|
|
38
38
|
self.bindEventHandlers = function() {
|
39
|
-
self.$checkout.on('click' , '[data-login-action]', self.
|
40
|
-
self.$checkout.on('submit', '#checkout-login form', self.
|
41
|
-
self.$checkout.on('click' , '#checkout-continue button', self.
|
42
|
-
|
39
|
+
self.$checkout.on('click' , '[data-login-action]', self.login_click_handler);
|
40
|
+
//self.$checkout.on('submit', '#checkout-login form', self.login_submit_handler);
|
41
|
+
//self.$checkout.on('click' , '#checkout-continue button', self.continue_handler);
|
43
42
|
$('#signin_form' ).submit(self.login_form_submit_handler);
|
44
43
|
$('#register_form').submit(self.register_form_submit_handler);
|
45
44
|
$('#guest_form' ).submit(self.guest_form_submit_handler);
|
46
45
|
};
|
47
46
|
|
48
|
-
self.
|
47
|
+
self.login_click_handler = function(event) {
|
49
48
|
var form = $(event.target).data('login-action');
|
50
49
|
if (self.current_form && form == self.current_form)
|
51
50
|
return;
|
@@ -64,52 +63,52 @@ Caboose.Store.Modules.CheckoutStep1 = (function() {
|
|
64
63
|
self.current_form = form;
|
65
64
|
};
|
66
65
|
|
67
|
-
self.
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
};
|
66
|
+
//self.login_submit_handler = function(event) {
|
67
|
+
// event.preventDefault();
|
68
|
+
// var $form = $(event.target);
|
69
|
+
//
|
70
|
+
// $.ajax({
|
71
|
+
// type: $form.attr('method'),
|
72
|
+
// url: $form.attr('action'),
|
73
|
+
// data: $form.serialize(),
|
74
|
+
// success: function(response) {
|
75
|
+
// if (response.error || (response.errors && response.errors.length > 0)) {
|
76
|
+
// if ($form.find('.message').length) {
|
77
|
+
// $form.find('.message').empty().addClass('error').text(response.error || response.errors[0]);
|
78
|
+
// } else {
|
79
|
+
// $form.append($('<span/>').addClass('message error').text(response.error || response.errors[0]));
|
80
|
+
// }
|
81
|
+
// } else {
|
82
|
+
// if (response.logged_in) {
|
83
|
+
// self.$login.after($('<p/>').addClass('alert').text('You are now signed in').css('text-align', 'center')).remove();
|
84
|
+
// $.post('/checkout/attach-user');
|
85
|
+
// } else {
|
86
|
+
// self.$login.after($('<p/>').addClass('alert').text('Email successfully saved').css('text-align', 'center')).remove();
|
87
|
+
// }
|
88
|
+
// }
|
89
|
+
//
|
90
|
+
// self.fetch(self.render);
|
91
|
+
// }
|
92
|
+
// });
|
93
|
+
//};
|
95
94
|
|
96
|
-
self.continueHandler = function(event) {
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
};
|
95
|
+
//self.continueHandler = function(event) {
|
96
|
+
// $form = self.$address.find('form');
|
97
|
+
//
|
98
|
+
// $.ajax({
|
99
|
+
// type: $form.attr('method'),
|
100
|
+
// url: $form.attr('action'),
|
101
|
+
// data: $form.serialize(),
|
102
|
+
// success: function(response) {
|
103
|
+
// if (response.success) {
|
104
|
+
// window.location = '/checkout/step-two';
|
105
|
+
// } else {
|
106
|
+
// $form.find('.message').remove();
|
107
|
+
// $form.find('#' + response.address + ' h3').append($('<span/>').addClass('message error').text(response.errors[0]));
|
108
|
+
// }
|
109
|
+
// }
|
110
|
+
// });
|
111
|
+
//};
|
113
112
|
|
114
113
|
self.login_form_submit_handler = function(event) {
|
115
114
|
$('#message').html("<p class='loading'>Logging in...</p>");
|
@@ -117,9 +116,19 @@ Caboose.Store.Modules.CheckoutStep1 = (function() {
|
|
117
116
|
url: '/login',
|
118
117
|
type: 'post',
|
119
118
|
data: $('#signin_form').serialize(),
|
120
|
-
success: function(resp) {
|
119
|
+
success: function(resp) {
|
121
120
|
if (resp.error) $('#message').html("<p class='note error'>" + resp.error + "</p>");
|
122
|
-
else
|
121
|
+
else
|
122
|
+
{
|
123
|
+
$.ajax({
|
124
|
+
url: '/checkout/attach-user',
|
125
|
+
type: 'post',
|
126
|
+
success: function(resp2) {
|
127
|
+
if (resp2.error) $('#message').html("<p class='note error'>" + resp2.error + "</p>");
|
128
|
+
//else window.location = '/checkout/step-two';
|
129
|
+
}
|
130
|
+
});
|
131
|
+
}
|
123
132
|
}
|
124
133
|
});
|
125
134
|
return false;
|
@@ -207,8 +207,12 @@ module CabooseStore
|
|
207
207
|
session[:cart_id] = nil
|
208
208
|
|
209
209
|
# Send out emails
|
210
|
-
|
211
|
-
|
210
|
+
begin
|
211
|
+
OrdersMailer.customer_new_order(@order).deliver
|
212
|
+
OrdersMailer.fulfillment_new_order(@order).deliver
|
213
|
+
rescue
|
214
|
+
|
215
|
+
end
|
212
216
|
|
213
217
|
# Emit order event
|
214
218
|
Caboose.plugin_hook('order_authorized', @order)
|