jekyll-spree-client 0.1.21 → 0.1.22
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/lib/jekyll/spree_client.rb +7 -17
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: d84e793a7b13924032e636bc9271c34526b50532a0d195fefec3d4ba396e9929
|
|
4
|
+
data.tar.gz: 43f88102b50e08f082e22db89899d51198e27d985dfc8b9aa52703ab53abc883
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 9e1e9fd39bd5bf077ef25471c283f23cbe988b59a54bb290a41526db79c0b3a7811a39bb45ec1fc051b956a9a35b2ce1bdd8e368aae110f3959c6d3de1c8fb17
|
|
7
|
+
data.tar.gz: a9053c799c246b4c70e43d909fc247642288a20dd1ee73b64e62edb3dd380641c6415faac60666da2ea1d378672327e7fc18eba517bd68a74eed9a3716c3e597
|
data/lib/jekyll/spree_client.rb
CHANGED
|
@@ -151,21 +151,6 @@ module Jekyll
|
|
|
151
151
|
@remote_products ||= spree.products(shipping_category_id: shipping_category_id)
|
|
152
152
|
end
|
|
153
153
|
|
|
154
|
-
# Obtain the default stock location, the first that's active.
|
|
155
|
-
#
|
|
156
|
-
# XXX: API doesn't show which one's the default so we're guessing.
|
|
157
|
-
#
|
|
158
|
-
# @return [Hash]
|
|
159
|
-
def stock_location
|
|
160
|
-
@stock_location ||=
|
|
161
|
-
if spree.stock_locations.index
|
|
162
|
-
spree.stock_locations.response['stock_locations']&.find { |s| s['active'] }
|
|
163
|
-
else
|
|
164
|
-
Jekyll.logger.warn "Couldn't get default stock location"
|
|
165
|
-
nil
|
|
166
|
-
end
|
|
167
|
-
end
|
|
168
|
-
|
|
169
154
|
# Fetch variants by SKU
|
|
170
155
|
#
|
|
171
156
|
# @param [Array]
|
|
@@ -247,9 +232,14 @@ module Jekyll
|
|
|
247
232
|
product.data['variant_id'] = variant_id
|
|
248
233
|
product.data['in_stock'] = product.data['stock'].to_i > 0
|
|
249
234
|
|
|
235
|
+
spree.variants.show(id: variant_id)
|
|
236
|
+
variant = spree.variants.response
|
|
237
|
+
|
|
250
238
|
# Add the initial stock
|
|
251
|
-
spree.stock_items(
|
|
252
|
-
|
|
239
|
+
spree.stock_items(
|
|
240
|
+
id: variant.dig('stock_items', 0, 'id'),
|
|
241
|
+
stock_location_id: variant.dig('stock_items', 0, 'stock_location_id')
|
|
242
|
+
).stock_movements.create(quantity: product.data['stock'])
|
|
253
243
|
|
|
254
244
|
true
|
|
255
245
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: jekyll-spree-client
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.22
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- f
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2026-04-17 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: spree-api-client
|
|
@@ -96,7 +96,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
96
96
|
- !ruby/object:Gem::Version
|
|
97
97
|
version: '0'
|
|
98
98
|
requirements: []
|
|
99
|
-
rubygems_version: 3.3.
|
|
99
|
+
rubygems_version: 3.3.27
|
|
100
100
|
signing_key:
|
|
101
101
|
specification_version: 4
|
|
102
102
|
summary: Spree Ecommerce API client for Jekyll
|