spree_google_merchant_feed 1.1.2 → 1.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 5efb0498b40ed2ac2d6dd0de0b4a1a39cec1c87f19b20f86135c271a9ac880ee
|
|
4
|
+
data.tar.gz: a5d8a1d76d0278aff9e3c33657fba0ab7e0b8ca3e1d5de7c36b9743dc0ba4090
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b2a55cfbbb48f038d50960b7a9968820c02b0641fbfdd69ef3f0bc4b28865e27fdab15dbca6be91114d0030cbdbcd8bb0d6c11bbe6496d52a3dc4de50bfdb130
|
|
7
|
+
data.tar.gz: 15b4c0046671c511205b980581569f4028e35a44f6c29c4b5a0716959994d9474539275001d3c007dcd1ac1ff9eabe68c663b3a079f00b6a06f932ca1377f74e
|
data/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Spree Google Merchant Feed
|
|
2
2
|
|
|
3
3
|
This is a Google Merchant extension for [Spree Commerce](https://spreecommerce.org), an open‑source e-commerce platform built with Ruby on Rails. It adds the ability to provide products listings to Google Merchant Center.
|
|
4
4
|
|
|
@@ -6,7 +6,7 @@ This is a Google Merchant extension for [Spree Commerce](https://spreecommerce.o
|
|
|
6
6
|
|
|
7
7
|
## Installation
|
|
8
8
|
|
|
9
|
-
1. Add this extension to your Gemfile:
|
|
9
|
+
1. Add this extension to your Gemfile with this line:
|
|
10
10
|
|
|
11
11
|
```bash
|
|
12
12
|
bundle add spree_google_merchant_feed
|
|
@@ -40,41 +40,28 @@ To use your Google Merchant endpoint as a data source in Google Merchant Center:
|
|
|
40
40
|
|
|
41
41
|
## Developing
|
|
42
42
|
|
|
43
|
-
1. Create a dummy app
|
|
43
|
+
1. Create a dummy app
|
|
44
44
|
|
|
45
45
|
```bash
|
|
46
46
|
bundle update
|
|
47
47
|
bundle exec rake test_app
|
|
48
48
|
```
|
|
49
49
|
|
|
50
|
-
2. Add code
|
|
50
|
+
2. Add your new code
|
|
51
51
|
|
|
52
|
-
3. Run tests
|
|
52
|
+
3. Run tests
|
|
53
53
|
|
|
54
54
|
```bash
|
|
55
55
|
bundle exec rspec
|
|
56
56
|
```
|
|
57
57
|
|
|
58
|
-
When testing your
|
|
58
|
+
When testing your applications integration with this extension you may use it's factories.
|
|
59
|
+
Simply add this require statement to your spec_helper:
|
|
59
60
|
|
|
60
61
|
```ruby
|
|
61
62
|
require 'spree_google_merchant_feed/factories'
|
|
62
63
|
```
|
|
63
64
|
|
|
64
|
-
## Testing
|
|
65
|
-
|
|
66
|
-
Generate the test app:
|
|
67
|
-
|
|
68
|
-
```bash
|
|
69
|
-
bundle exec rake test_app
|
|
70
|
-
```
|
|
71
|
-
|
|
72
|
-
Then run:
|
|
73
|
-
|
|
74
|
-
```bash
|
|
75
|
-
bundle exec rspec
|
|
76
|
-
```
|
|
77
|
-
|
|
78
65
|
## Releasing a new version
|
|
79
66
|
|
|
80
67
|
```bash
|
|
@@ -15,22 +15,42 @@ xml.rss version: "2.0", "xmlns:g" => "http://base.google.com/ns/1.0" do
|
|
|
15
15
|
xml.tag! "g:title", product.name.truncate(150)
|
|
16
16
|
xml.tag! "g:description", product.storefront_description&.truncate(5000)
|
|
17
17
|
xml.tag! "g:link", spree_storefront_resource_url(product)
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
|
|
19
|
+
if product.featured_image.present?
|
|
20
|
+
xml.tag! "g:image_link", spree_image_url(product.featured_image, width: 500, height: 500)
|
|
21
|
+
end
|
|
22
|
+
product.master_images.each do |image|
|
|
23
|
+
next if product.featured_image == image
|
|
24
|
+
|
|
25
|
+
xml.tag! "g:additional_image_link" do
|
|
26
|
+
xml.cdata! spree_image_url(image, width: 500, height: 500)
|
|
27
|
+
end
|
|
20
28
|
end
|
|
21
29
|
|
|
22
30
|
# Price and availability
|
|
23
|
-
|
|
31
|
+
if product.in_stock?
|
|
32
|
+
xml.tag! "g:availability", "in_stock"
|
|
33
|
+
elsif product.backorderable?
|
|
34
|
+
xml.tag! "g:availability", "backorder"
|
|
35
|
+
elsif !product.in_stock?
|
|
36
|
+
xml.tag! "g:availability", "out_of_stock"
|
|
37
|
+
end
|
|
38
|
+
|
|
24
39
|
xml.tag! "g:availability_date", product.available_on.strftime("%Y-%m-%dT%H:%M%z") if product.available_on?
|
|
25
40
|
xml.tag! "g:expiration_date", product.discontinue_on.strftime("%Y-%m-%dT%H:%M%z") if product.discontinue_on?
|
|
26
|
-
|
|
27
|
-
|
|
41
|
+
|
|
42
|
+
if product.on_sale?(current_store.default_currency)
|
|
43
|
+
xml.tag! "g:price", format('%.2f', product.display_compare_at_price.to_d) + " " + current_currency
|
|
44
|
+
xml.tag! "g:sale_price", format('%.2f', product.display_price.to_d) + " " + current_currency
|
|
45
|
+
else
|
|
46
|
+
xml.tag! "g:price", format('%.2f', product.display_price.to_d) + " " + current_currency
|
|
47
|
+
end
|
|
28
48
|
|
|
29
49
|
# Product category
|
|
30
50
|
xml.tag! "g:product_type", product_breadcrumb_taxons(product).map(&:name).join(' > ')
|
|
31
51
|
|
|
32
52
|
# Product identifiers
|
|
33
|
-
xml.tag! "g:brand", product.
|
|
53
|
+
xml.tag! "g:brand", product.brand_taxon.name if product.brand_taxon.present?
|
|
34
54
|
|
|
35
55
|
# Detailed product description
|
|
36
56
|
xml.tag! "g:product_weight", "#{product.weight} #{product.weight_unit}" if product.weight.present?
|
|
@@ -17,8 +17,8 @@ module SpreeGoogleMerchantFeed
|
|
|
17
17
|
app.config.assets.precompile += %w[spree_google_merchant_feed_manifest]
|
|
18
18
|
end
|
|
19
19
|
|
|
20
|
-
initializer 'spree_google_merchant_feed.importmap',
|
|
21
|
-
app.config.
|
|
20
|
+
initializer 'spree_google_merchant_feed.importmap', before: 'importmap' do |app|
|
|
21
|
+
app.config.importmap.paths << root.join('config/importmap.rb')
|
|
22
22
|
end
|
|
23
23
|
|
|
24
24
|
def self.activate
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: spree_google_merchant_feed
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.1.
|
|
4
|
+
version: 1.1.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- OlympusOne
|
|
@@ -15,42 +15,42 @@ dependencies:
|
|
|
15
15
|
requirements:
|
|
16
16
|
- - ">="
|
|
17
17
|
- !ruby/object:Gem::Version
|
|
18
|
-
version: 5.
|
|
18
|
+
version: 5.2.0
|
|
19
19
|
type: :runtime
|
|
20
20
|
prerelease: false
|
|
21
21
|
version_requirements: !ruby/object:Gem::Requirement
|
|
22
22
|
requirements:
|
|
23
23
|
- - ">="
|
|
24
24
|
- !ruby/object:Gem::Version
|
|
25
|
-
version: 5.
|
|
25
|
+
version: 5.2.0
|
|
26
26
|
- !ruby/object:Gem::Dependency
|
|
27
27
|
name: spree_storefront
|
|
28
28
|
requirement: !ruby/object:Gem::Requirement
|
|
29
29
|
requirements:
|
|
30
30
|
- - ">="
|
|
31
31
|
- !ruby/object:Gem::Version
|
|
32
|
-
version: 5.
|
|
32
|
+
version: 5.2.0
|
|
33
33
|
type: :runtime
|
|
34
34
|
prerelease: false
|
|
35
35
|
version_requirements: !ruby/object:Gem::Requirement
|
|
36
36
|
requirements:
|
|
37
37
|
- - ">="
|
|
38
38
|
- !ruby/object:Gem::Version
|
|
39
|
-
version: 5.
|
|
39
|
+
version: 5.2.0
|
|
40
40
|
- !ruby/object:Gem::Dependency
|
|
41
41
|
name: spree_admin
|
|
42
42
|
requirement: !ruby/object:Gem::Requirement
|
|
43
43
|
requirements:
|
|
44
44
|
- - ">="
|
|
45
45
|
- !ruby/object:Gem::Version
|
|
46
|
-
version: 5.
|
|
46
|
+
version: 5.2.0
|
|
47
47
|
type: :runtime
|
|
48
48
|
prerelease: false
|
|
49
49
|
version_requirements: !ruby/object:Gem::Requirement
|
|
50
50
|
requirements:
|
|
51
51
|
- - ">="
|
|
52
52
|
- !ruby/object:Gem::Version
|
|
53
|
-
version: 5.
|
|
53
|
+
version: 5.2.0
|
|
54
54
|
- !ruby/object:Gem::Dependency
|
|
55
55
|
name: spree_extension
|
|
56
56
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -108,10 +108,10 @@ licenses:
|
|
|
108
108
|
- AGPL-3.0-or-later
|
|
109
109
|
metadata:
|
|
110
110
|
bug_tracker_uri: https://github.com/olympusone/spree_google_merchant_feed/issues
|
|
111
|
-
changelog_uri: https://github.com/olympusone/spree_google_merchant_feed/releases/tag/v1.1.
|
|
111
|
+
changelog_uri: https://github.com/olympusone/spree_google_merchant_feed/releases/tag/v1.1.3
|
|
112
112
|
documentation_uri: https://github.com/olympusone/spree_google_merchant_feed
|
|
113
113
|
homepage_uri: https://github.com/olympusone/spree_google_merchant_feed
|
|
114
|
-
source_code_uri: https://github.com/olympusone/spree_google_merchant_feed/tree/v1.1.
|
|
114
|
+
source_code_uri: https://github.com/olympusone/spree_google_merchant_feed/tree/v1.1.3
|
|
115
115
|
rdoc_options: []
|
|
116
116
|
require_paths:
|
|
117
117
|
- lib
|