solidus_seo 1.1.1 → 1.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/decorators/controllers/spree/orders_controller_decorator.rb +1 -0
- data/app/views/solidus_seo/_facebook.html.erb +1 -0
- data/app/views/solidus_seo/_pinterest.html.erb +1 -1
- data/lib/solidus_seo/version.rb +1 -1
- data/spec/examples.txt +38 -38
- data/spec/features/add_to_cart_spec.rb +9 -7
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b271de06999564680b05f6bc567792f8bf7fa7e6c5f6724657e99c11b49f9863
|
4
|
+
data.tar.gz: 6b02664bd4631e08156e8f844e0e8c366a164d59a2c4cda90e4e2f52f65a752e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cf416b0189fde7be68c93ededdf8a1db518e4df9c9f1df826e54c5880654c6340413846ad318103aa201092cbdea1b72109d373a0894d0a5e4c97303d1c547c5
|
7
|
+
data.tar.gz: 71d3bfe67f0bf775289419f2e0cc1e70cac2719d8b54b17c083f5253350c83cd6d039ad57bbfdb8330aa4cb38266bc1f3a88cd6c97460786239c0a6c950e7246
|
@@ -26,6 +26,7 @@ module Spree
|
|
26
26
|
cart_diff = cart_diff.map do |variant_sku, quantity|
|
27
27
|
variant_hash = cart_diff_variant_payload(variant_sku)
|
28
28
|
variant_hash[:quantity] = quantity
|
29
|
+
variant_hash[:amount] = quantity * variant_hash[:price]
|
29
30
|
|
30
31
|
[variant_sku, variant_hash]
|
31
32
|
end.to_h
|
@@ -24,6 +24,7 @@ if order.present?
|
|
24
24
|
|
25
25
|
if flash[:added_to_cart].present?
|
26
26
|
event_data[:added_to_cart] = {
|
27
|
+
value: flash[:added_to_cart].sum { |sku, hash| hash['amount'].to_d },
|
27
28
|
currency: order.currency,
|
28
29
|
content_type: 'product',
|
29
30
|
contents: flash[:added_to_cart].map do |variant_sku, variant|
|
@@ -31,7 +31,7 @@ if order.present?
|
|
31
31
|
|
32
32
|
if flash[:added_to_cart].present?
|
33
33
|
event_data[:added_to_cart] = {
|
34
|
-
value:
|
34
|
+
value: flash[:added_to_cart].sum { |sku, hash| hash['amount'].to_d },
|
35
35
|
currency: order.currency,
|
36
36
|
order_id: order.number,
|
37
37
|
line_items: flash[:added_to_cart].map do |variant_sku, variant|
|
data/lib/solidus_seo/version.rb
CHANGED
data/spec/examples.txt
CHANGED
@@ -1,40 +1,40 @@
|
|
1
1
|
example_id | status | run_time |
|
2
2
|
------------------------------------------------- | ------- | --------------- |
|
3
|
-
./spec/features/add_to_cart_spec.rb[1:1:1] | passed | 0.
|
4
|
-
./spec/features/add_to_cart_spec.rb[1:2:1] | passed | 0.
|
5
|
-
./spec/features/add_to_cart_spec.rb[1:2:2] | passed | 0.
|
6
|
-
./spec/features/checkout_complete_spec.rb[1:1:1] | passed |
|
7
|
-
./spec/features/checkout_complete_spec.rb[1:2:1] | passed | 0.
|
8
|
-
./spec/features/checkout_complete_spec.rb[1:3:1] | passed | 0.
|
9
|
-
./spec/features/checkout_complete_spec.rb[1:4:1] | passed |
|
10
|
-
./spec/features/checkout_initiated_spec.rb[1:1:1] | pending |
|
11
|
-
./spec/features/checkout_initiated_spec.rb[1:2:1] | pending | 0.
|
12
|
-
./spec/features/checkout_initiated_spec.rb[1:3:1] | passed |
|
13
|
-
./spec/features/checkout_initiated_spec.rb[1:4:1] | pending | 0.
|
14
|
-
./spec/features/homepage_spec.rb[1:1:1] | passed | 0.
|
15
|
-
./spec/features/homepage_spec.rb[1:1:2] | passed | 0.
|
16
|
-
./spec/features/homepage_spec.rb[1:2:1] | passed | 0.
|
17
|
-
./spec/features/homepage_spec.rb[1:2:2] | passed | 0.
|
18
|
-
./spec/features/homepage_spec.rb[1:3:1] | passed | 0.
|
19
|
-
./spec/features/homepage_spec.rb[1:3:2] | passed | 0.
|
20
|
-
./spec/features/homepage_spec.rb[1:4:1:1] | passed | 0.
|
21
|
-
./spec/features/product_page_spec.rb[1:1:1] | passed |
|
22
|
-
./spec/features/product_page_spec.rb[1:1:2] | passed | 0.
|
23
|
-
./spec/features/product_page_spec.rb[1:1:3] | passed | 0.
|
24
|
-
./spec/features/product_page_spec.rb[1:2:1] | passed | 0.
|
25
|
-
./spec/features/product_page_spec.rb[1:2:2:1] | passed | 0.
|
26
|
-
./spec/features/product_page_spec.rb[1:2:3:1] | passed | 0.
|
27
|
-
./spec/features/product_page_spec.rb[1:3:1] | passed | 0.
|
28
|
-
./spec/features/product_page_spec.rb[1:3:2] | passed | 0.
|
29
|
-
./spec/features/product_page_spec.rb[1:3:3] | passed | 0.
|
30
|
-
./spec/features/product_page_spec.rb[1:4:1:1] | passed | 0.
|
31
|
-
./spec/features/product_page_spec.rb[1:4:2:1] | passed | 0.
|
32
|
-
./spec/features/taxon_page_spec.rb[1:1:1] | passed | 0.
|
33
|
-
./spec/features/taxon_page_spec.rb[1:1:2] | passed | 0.
|
34
|
-
./spec/features/taxon_page_spec.rb[1:1:3] | passed | 0.
|
35
|
-
./spec/features/taxon_page_spec.rb[1:2:1] | passed | 0.
|
36
|
-
./spec/features/taxon_page_spec.rb[1:2:2:1] | passed | 0.
|
37
|
-
./spec/features/taxon_page_spec.rb[1:2:3:1] | passed | 0.
|
38
|
-
./spec/features/taxon_page_spec.rb[1:3:1] | passed | 0.
|
39
|
-
./spec/features/taxon_page_spec.rb[1:3:2] | passed | 0.
|
40
|
-
./spec/features/taxon_page_spec.rb[1:4:1] | passed | 0.
|
3
|
+
./spec/features/add_to_cart_spec.rb[1:1:1] | passed | 0.66081 seconds |
|
4
|
+
./spec/features/add_to_cart_spec.rb[1:2:1] | passed | 0.75237 seconds |
|
5
|
+
./spec/features/add_to_cart_spec.rb[1:2:2] | passed | 0.67545 seconds |
|
6
|
+
./spec/features/checkout_complete_spec.rb[1:1:1] | passed | 1.07 seconds |
|
7
|
+
./spec/features/checkout_complete_spec.rb[1:2:1] | passed | 0.58496 seconds |
|
8
|
+
./spec/features/checkout_complete_spec.rb[1:3:1] | passed | 0.47447 seconds |
|
9
|
+
./spec/features/checkout_complete_spec.rb[1:4:1] | passed | 0.63761 seconds |
|
10
|
+
./spec/features/checkout_initiated_spec.rb[1:1:1] | pending | 0.1245 seconds |
|
11
|
+
./spec/features/checkout_initiated_spec.rb[1:2:1] | pending | 0.11937 seconds |
|
12
|
+
./spec/features/checkout_initiated_spec.rb[1:3:1] | passed | 0.97884 seconds |
|
13
|
+
./spec/features/checkout_initiated_spec.rb[1:4:1] | pending | 0.12569 seconds |
|
14
|
+
./spec/features/homepage_spec.rb[1:1:1] | passed | 0.28455 seconds |
|
15
|
+
./spec/features/homepage_spec.rb[1:1:2] | passed | 0.2939 seconds |
|
16
|
+
./spec/features/homepage_spec.rb[1:2:1] | passed | 0.29915 seconds |
|
17
|
+
./spec/features/homepage_spec.rb[1:2:2] | passed | 0.28221 seconds |
|
18
|
+
./spec/features/homepage_spec.rb[1:3:1] | passed | 0.36746 seconds |
|
19
|
+
./spec/features/homepage_spec.rb[1:3:2] | passed | 0.30991 seconds |
|
20
|
+
./spec/features/homepage_spec.rb[1:4:1:1] | passed | 0.49752 seconds |
|
21
|
+
./spec/features/product_page_spec.rb[1:1:1] | passed | 3.76 seconds |
|
22
|
+
./spec/features/product_page_spec.rb[1:1:2] | passed | 0.46834 seconds |
|
23
|
+
./spec/features/product_page_spec.rb[1:1:3] | passed | 0.43108 seconds |
|
24
|
+
./spec/features/product_page_spec.rb[1:2:1] | passed | 0.43884 seconds |
|
25
|
+
./spec/features/product_page_spec.rb[1:2:2:1] | passed | 0.37689 seconds |
|
26
|
+
./spec/features/product_page_spec.rb[1:2:3:1] | passed | 0.40017 seconds |
|
27
|
+
./spec/features/product_page_spec.rb[1:3:1] | passed | 0.34652 seconds |
|
28
|
+
./spec/features/product_page_spec.rb[1:3:2] | passed | 0.42483 seconds |
|
29
|
+
./spec/features/product_page_spec.rb[1:3:3] | passed | 0.38935 seconds |
|
30
|
+
./spec/features/product_page_spec.rb[1:4:1:1] | passed | 0.58891 seconds |
|
31
|
+
./spec/features/product_page_spec.rb[1:4:2:1] | passed | 0.92141 seconds |
|
32
|
+
./spec/features/taxon_page_spec.rb[1:1:1] | passed | 0.45357 seconds |
|
33
|
+
./spec/features/taxon_page_spec.rb[1:1:2] | passed | 0.37813 seconds |
|
34
|
+
./spec/features/taxon_page_spec.rb[1:1:3] | passed | 0.4267 seconds |
|
35
|
+
./spec/features/taxon_page_spec.rb[1:2:1] | passed | 0.43519 seconds |
|
36
|
+
./spec/features/taxon_page_spec.rb[1:2:2:1] | passed | 0.41135 seconds |
|
37
|
+
./spec/features/taxon_page_spec.rb[1:2:3:1] | passed | 0.42165 seconds |
|
38
|
+
./spec/features/taxon_page_spec.rb[1:3:1] | passed | 0.41839 seconds |
|
39
|
+
./spec/features/taxon_page_spec.rb[1:3:2] | passed | 0.39104 seconds |
|
40
|
+
./spec/features/taxon_page_spec.rb[1:4:1] | passed | 0.66123 seconds |
|
@@ -2,16 +2,18 @@
|
|
2
2
|
|
3
3
|
describe 'Add to cart', type: :system do
|
4
4
|
let!(:store) { create(:store) }
|
5
|
-
let!(:
|
6
|
-
let
|
5
|
+
let!(:product) { create(:product) }
|
6
|
+
let(:line_item_quantity) { 2 }
|
7
|
+
let(:order) { Spree::Order.last }
|
8
|
+
let(:line_item) { order.line_items.first }
|
7
9
|
|
8
10
|
stub_authorization!
|
9
11
|
|
10
12
|
before do
|
11
|
-
current_order_stubs(order)
|
12
13
|
stub_const 'ENV', ENV.to_h.merge(env_variable => 'XXX-YYYYY')
|
13
14
|
|
14
|
-
visit spree.product_path(
|
15
|
+
visit spree.product_path(product)
|
16
|
+
fill_in('quantity', with: line_item_quantity)
|
15
17
|
find('#add-to-cart-button').click
|
16
18
|
end
|
17
19
|
|
@@ -20,7 +22,7 @@ describe 'Add to cart', type: :system do
|
|
20
22
|
|
21
23
|
it 'tracks "add to cart" event with product data' do
|
22
24
|
expect(page).to track_analytics_event :facebook, 'addtocart', [
|
23
|
-
'fbq', 'track', 'AddToCart', line_item.sku
|
25
|
+
'fbq', 'track', 'AddToCart', line_item.amount, line_item.sku
|
24
26
|
]
|
25
27
|
end
|
26
28
|
end
|
@@ -30,8 +32,8 @@ describe 'Add to cart', type: :system do
|
|
30
32
|
|
31
33
|
it 'tracks "add to cart" event' do
|
32
34
|
expect(page).to track_analytics_event :pinterest, 'addtocart', [
|
33
|
-
'track', 'addtocart',
|
34
|
-
line_item.name, line_item.
|
35
|
+
'track', 'addtocart', line_item.amount, order.number, line_item.product.sku,
|
36
|
+
line_item.name, line_item.sku, line_item.price
|
35
37
|
]
|
36
38
|
end
|
37
39
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: solidus_seo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Karma Creative
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-08-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: solidus_core
|