spree_quick_cart 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 05c51a09b92bc336110b8e337af7993e6fb7c524
4
- data.tar.gz: 6591fd686a8c1591682ed664f9888dfb4f4c3bd6
3
+ metadata.gz: e864553378eec6999b99c36d5d406d2408348504
4
+ data.tar.gz: 7a50820164eb2dbc55f13e89b14e7202e2fae3d0
5
5
  SHA512:
6
- metadata.gz: 726f668e459d93613399c3d4893b3ed22dd08ebbd810c41958781c363c663e364dba8b016e44c2e60aec637785255bbaa80610fe500c97c67f5273810a2a31e6
7
- data.tar.gz: b78dc7bda56df32f8f9218e2583ce8e04a662b9ab250ee046951e98f806dc3f536b09d35fc9005874a503405ee9e5629c5163264001ff88b58914db58b89423b
6
+ metadata.gz: 005285203b78f4a645c598f9e2ff5de71150bca93f9afe6ed03278780a3ae3f435100155c6faf53b7b431ab3b587fb60c68aa9a659daf01505b4f8ce9319243b
7
+ data.tar.gz: 42f6ef571c2d056c93d844329702aba826542d5189b23d9357229445bcc670d1fc7bb153785ab93771b7445d0b45294616919328b25fde26fa177370270533b2
@@ -4,6 +4,7 @@ function SpreeQuickCart() {
4
4
 
5
5
  this.initializeQuickCartForm = function() {
6
6
  $(".quick-add-to-cart-form").find("form").submit(function() {
7
+ that.current_order_path = $(this).closest(".quick-add-to-cart-form").find('.current-order-path').text();
7
8
  Spree.ajax({
8
9
  url: $(this).attr("action"),
9
10
  type: "POST",
@@ -22,7 +23,7 @@ function SpreeQuickCart() {
22
23
 
23
24
  this.replaceCartInformation = function() {
24
25
  Spree.ajax({
25
- url: '/shop/api/orders/current',
26
+ url: that.current_order_path,
26
27
  type: "GET",
27
28
  cache: false,
28
29
  dataType: 'json',
@@ -1,6 +1,8 @@
1
1
  .quick-add-to-cart-form
2
2
  - order = Spree::Order.find(session[:order_id]) if session[:order_id]
3
3
  - if order
4
+ %span.current-order-path(style="display:none")
5
+ = current_api_orders_path
4
6
  = form_tag api_order_line_items_path(order.number), method: :post do
5
7
  .fields
6
8
  = hidden_field_tag "order_token", order.token
@@ -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.1.1'
5
+ s.version = '0.1.2'
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'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spree_quick_cart
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Francisco Trindade