spree_google_merchant_feed 1.1.2 → 1.1.4
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 +4 -4
- data/README.md +8 -21
- data/app/assets/config/spree_google_merchant_feed_manifest.js +0 -1
- data/app/views/spree_google_merchant_feed/products.xml.builder +26 -6
- data/config/initializers/spree.rb +1 -1
- data/lib/spree_google_merchant_feed/engine.rb +2 -2
- data/lib/spree_google_merchant_feed/version.rb +1 -1
- metadata +10 -11
- data/LICENSE.md +0 -15
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 21b303d025d3202e7d3299255d0e1ae95fcdaafc4d48d69dd162a3e807e2e65c
|
|
4
|
+
data.tar.gz: a07ace2a6fbe8aa1f805e67b0171de932b8fabbdca622576b4cb2a62fa0d2689
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: f78399f057b8e7ac066399d169132c42252a0fa7eaadecc05ebd2b8879a469a933ea819df74c1525620fce1179c802b72b5083cf7ae4a67c24cc26e7db793eaa
|
|
7
|
+
data.tar.gz: d7882d5fec1ff131e2e7849b2549458671e3a84b2922085303d11c05f3d2d510d984640984174136976ac2c7f98f4cbb970ece38e6d12d88250e2fdc033c48be
|
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
|
|
@@ -90,4 +77,4 @@ If you'd like to contribute, please take a look at the
|
|
|
90
77
|
[instructions](CONTRIBUTING.md) for installing dependencies and crafting a good
|
|
91
78
|
pull request.
|
|
92
79
|
|
|
93
|
-
Copyright (c)
|
|
80
|
+
Copyright (c) 2026 OlympusOne, released under the MIT License.
|
|
@@ -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.4
|
|
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
|
|
@@ -85,7 +85,6 @@ executables: []
|
|
|
85
85
|
extensions: []
|
|
86
86
|
extra_rdoc_files: []
|
|
87
87
|
files:
|
|
88
|
-
- LICENSE.md
|
|
89
88
|
- README.md
|
|
90
89
|
- Rakefile
|
|
91
90
|
- app/assets/config/spree_google_merchant_feed_manifest.js
|
|
@@ -105,13 +104,13 @@ files:
|
|
|
105
104
|
- lib/spree_google_merchant_feed/version.rb
|
|
106
105
|
homepage: https://github.com/olympusone/spree_google_merchant_feed
|
|
107
106
|
licenses:
|
|
108
|
-
-
|
|
107
|
+
- MIT
|
|
109
108
|
metadata:
|
|
110
109
|
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.
|
|
110
|
+
changelog_uri: https://github.com/olympusone/spree_google_merchant_feed/releases/tag/v1.1.4
|
|
112
111
|
documentation_uri: https://github.com/olympusone/spree_google_merchant_feed
|
|
113
112
|
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.
|
|
113
|
+
source_code_uri: https://github.com/olympusone/spree_google_merchant_feed/tree/v1.1.4
|
|
115
114
|
rdoc_options: []
|
|
116
115
|
require_paths:
|
|
117
116
|
- lib
|
data/LICENSE.md
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
# LICENSE
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2025 OlympusOne. All rights reserved.
|
|
4
|
-
|
|
5
|
-
This program is free software: you can redistribute it and/or modify it under the terms of the
|
|
6
|
-
GNU Affero General Public License as published by the Free Software Foundation, either
|
|
7
|
-
version 3 of the License, or any later version.
|
|
8
|
-
|
|
9
|
-
This program is distributed in the hope that it will be useful,
|
|
10
|
-
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
11
|
-
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
12
|
-
GNU Affero General Public License for more details.
|
|
13
|
-
|
|
14
|
-
You should have received a copy of the GNU Affero General Public License
|
|
15
|
-
along with this program. If not, see [https://www.gnu.org/licenses/](https://www.gnu.org/licenses/).
|