huginn_bigcommerce_product_agent 1.4.1 → 1.4.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
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4212c209c32fafb12fc7746a038bcb4c20af8cde053cb2adc44cff87e8112433
|
4
|
+
data.tar.gz: 4dd2faafdf9ab8422eacd7c407ccf35549a69ace3df0a9a748c09bc91a038ffc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c871f927452151ecd880b7b68731d8629100262911c9fc7d4566cf7f31a29c626bedba74f5dcb83dbd135413a95a781042d1e6408b060c00e0bf4106c408d2af
|
7
|
+
data.tar.gz: a275f1a162b1a7ed5633b5e0868766eb9e41b9b1ce0e8a024c5bc241183bf286ddc582f53df9b580e2ea3cb52b7ad6de51bdc1274b13857ecb153a206e924ce3
|
@@ -28,7 +28,8 @@ module Agents
|
|
28
28
|
'custom_fields_map' => {},
|
29
29
|
'meta_fields_map' => {},
|
30
30
|
'meta_fields_namespace' => '',
|
31
|
-
'mode' => modes[0]
|
31
|
+
'mode' => modes[0],
|
32
|
+
'not_purchasable_format_list' => []
|
32
33
|
}
|
33
34
|
end
|
34
35
|
|
@@ -62,6 +63,10 @@ module Agents
|
|
62
63
|
unless options['mode'].present? && modes.include?(options['mode'])
|
63
64
|
errors.add(:base, "mode is a required field and must be one of: #{modes.join(', ')}")
|
64
65
|
end
|
66
|
+
|
67
|
+
unless options['not_purchasable_format_list'].present? && !options['not_purchasable_format_list'].is_a?(Array)
|
68
|
+
errors.add(:base, 'not_purchasable_format_list must be an Array')
|
69
|
+
end
|
65
70
|
end
|
66
71
|
|
67
72
|
def working?
|
@@ -183,6 +188,8 @@ module Agents
|
|
183
188
|
[option_value],
|
184
189
|
product_id,
|
185
190
|
bc_variant.nil? ? nil : bc_variant['id'],
|
191
|
+
interpolated['not_purchasable_format_list'],
|
192
|
+
bc_option_value
|
186
193
|
)
|
187
194
|
end
|
188
195
|
|
@@ -28,7 +28,7 @@ module BigcommerceProductAgent
|
|
28
28
|
sku: product ? product['sku'] : default_sku,
|
29
29
|
is_default: product['isDefault'],
|
30
30
|
type: product['isDigital'] == true || is_digital ? 'digital' : 'physical',
|
31
|
-
description: product['description'],
|
31
|
+
description: product['description'] || '',
|
32
32
|
price: product['offers'] && product['offers'][0] ? product['offers'][0]['price'] : '0',
|
33
33
|
categories: self.get_categories(product),
|
34
34
|
available: 'available',
|
@@ -37,7 +37,7 @@ module BigcommerceProductAgent
|
|
37
37
|
depth: product['depth'] ? product['depth']['value'] : '0',
|
38
38
|
height: product['height'] ? product['height']['value'] : '0',
|
39
39
|
meta_keywords: self.meta_keywords(product),
|
40
|
-
meta_description: self.meta_description(product),
|
40
|
+
meta_description: self.meta_description(product) || '',
|
41
41
|
search_keywords: self.meta_keywords(product).join(','),
|
42
42
|
is_visible: variant ? false : true,
|
43
43
|
}
|
@@ -2,7 +2,7 @@ module BigcommerceProductAgent
|
|
2
2
|
module Mapper
|
3
3
|
class VariantMapper
|
4
4
|
|
5
|
-
def self.map(variant, option_values, product_id, variant_id=nil)
|
5
|
+
def self.map(variant, option_values, product_id, variant_id=nil, not_purchasable_format_list, bc_option_value)
|
6
6
|
mapped = {
|
7
7
|
product_id: product_id,
|
8
8
|
sku: variant['sku'],
|
@@ -29,6 +29,14 @@ module BigcommerceProductAgent
|
|
29
29
|
mapped[:id] = variant_id
|
30
30
|
end
|
31
31
|
|
32
|
+
unless not_purchasable_format_list.nil?
|
33
|
+
not_purchasable_format_list.each do |format|
|
34
|
+
if format == bc_option_value['label']
|
35
|
+
mapped[:purchasing_disabled] = true
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
32
40
|
return mapped
|
33
41
|
end
|
34
42
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: huginn_bigcommerce_product_agent
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.4.
|
4
|
+
version: 1.4.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jacob Spizziri
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-05
|
11
|
+
date: 2020-06-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|