spree_quick_cart 0.1.2 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/javascripts/store/quick_cart.js +13 -3
- data/spree_quick_cart.gemspec +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 98bf99bf695e7d1432b8b6929aeb3c42be63b913
|
4
|
+
data.tar.gz: dd71bcc808b8a9436911fbb4bbe57bfd5802d78c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 330c221ed93596bb8c8b51eda12dbbbadb468168978868fb0ce4969e6b6c3cae518e8bc825e094c1beaefa4bfdae6183b7925e93cad585ca328505104f4fa75a
|
7
|
+
data.tar.gz: 7387870a91bbbc6ae911d55db1d326d46869c849a958f7b3e5a3de1bd11a256f4fc13e5fc8b34d3376e582926ded49ba320e5e28c3fdad65b6ff0a9696e59f22
|
@@ -14,13 +14,22 @@ function SpreeQuickCart() {
|
|
14
14
|
that.replaceCartInformation();
|
15
15
|
},
|
16
16
|
error: function(data, textStatus, jqXHR) {
|
17
|
-
|
17
|
+
that.showFlashMessage('There was a problem adding the item to the cart. Please reload the page and try again.', false);
|
18
18
|
}
|
19
19
|
});
|
20
20
|
return false;
|
21
21
|
});
|
22
22
|
};
|
23
23
|
|
24
|
+
this.showFlashMessage = function(message, success) {
|
25
|
+
var messageClass;
|
26
|
+
if (success == true){ messageClass = 'success'} else { messageClass = 'error' };
|
27
|
+
$('#content').prepend("<div class='flash " + messageClass + "'>" + message + "</div>");
|
28
|
+
timeoutID = window.setTimeout(function(){
|
29
|
+
$('#content').find(".flash.success").remove();
|
30
|
+
}, 3000);
|
31
|
+
};
|
32
|
+
|
24
33
|
this.replaceCartInformation = function() {
|
25
34
|
Spree.ajax({
|
26
35
|
url: that.current_order_path,
|
@@ -31,12 +40,13 @@ function SpreeQuickCart() {
|
|
31
40
|
total = data.item_total;
|
32
41
|
items_count = data.item_count;
|
33
42
|
$('#link-to-cart .cart-info').html("Cart: (" + items_count + ") <span class='amount'>$" + total + "</span>")
|
43
|
+
that.showFlashMessage('Item added to the cart successfully.', true);
|
34
44
|
},
|
35
45
|
error: function(data, textStatus, jqXHR) {
|
36
|
-
|
46
|
+
that.showFlashMessage('There was a problem adding the item to the cart. Please reload the page and try again.', false);
|
37
47
|
}
|
38
48
|
});
|
39
|
-
}
|
49
|
+
};
|
40
50
|
|
41
51
|
}
|
42
52
|
|
data/spree_quick_cart.gemspec
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
Gem::Specification.new do |s|
|
3
3
|
s.platform = Gem::Platform::RUBY
|
4
4
|
s.name = 'spree_quick_cart'
|
5
|
-
s.version = '0.
|
5
|
+
s.version = '0.2.0'
|
6
6
|
s.summary = 'Insert add to cart button in product index page'
|
7
7
|
s.description = 'Adds js quick add to cart button to product catalogue'
|
8
8
|
s.required_ruby_version = '>= 2.0.0'
|