forked from gillkyle/shopify-csv-generator
-
Notifications
You must be signed in to change notification settings - Fork 1
/
simple_product.rb
123 lines (116 loc) · 2.79 KB
/
simple_product.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
class SimpleProduct < Product
attr_accessor :parent_product
def initialize args, parent_product
args.each do |k,v|
instance_variable_set("@#{k}", v) unless v.nil?
end
@parent_product = parent_product
@keys = [:handle, :title, :body, :vendor, :type, :tags, :published, :option1_name, :option1_value, :option2_name, :option2_value, :option3_name, :option3_value, :variant_sku, :variant_grams, :variant_inventory_tracker, :variant_inventory_policy, :variant_inventory_quantity, :variant_fullfilment_service, :variant_price, :variant_compare_at_price, :variant_requires_shipping, :variant_taxable, :variant_barcode, :image_src, :image_alt_text, :gift_card, :google_shopping_mpn, :google_shopping_age_group, :google_shopping_gender, :google_shopping_google_product_category, :seo_title, :seo_description, :google_shopping_adwords_grouping, :google_shopping_adwords_labels, :google_shopping_condition, :google_shopping_custom_product, :google_shopping_custom_label_0, :google_shopping_custom_label_1, :google_shopping_custom_label_2, :google_shopping_custom_label_3, :google_shopping_custom_label_4, :variant_image, :variant_weight_unit]
populate_values @keys
end
def gen_title
return ''
end
def gen_body
''
end
def gen_vendor
''
end
def gen_type
''
end
def gen_tags
''
end
def gen_published
''
end
def gen_option1_value
return ['Small','Medium','Large'].sample
end
def gen_option2_name
return ''
end
def gen_option2_value
return ''
end
def gen_option3_name
return ''
end
def gen_option3_value
return ''
end
def gen_variant_sku
return "#{@handle}-#{@option1_value.downcase}"
end
def gen_variant_grams
return Faker::Number.between(from: 20, to: 1000)
end
def gen_variant_price
return @parent_product.variant_price
end
def gen_variant_compare_at_price
return ''
end
def gen_image_src
''
end
def gen_image_alt_text
''
end
def gen_gift_card
''
end
def gen_google_shopping_mpn
''
end
def gen_google_shopping_age_group
''
end
def gen_google_shopping_gender
''
end
def gen_google_shopping_google_product_category
''
end
def gen_seo_title
''
end
def gen_seo_description
''
end
def gen_google_shopping_adwords_grouping
''
end
def gen_google_shopping_adwords_labels
''
end
def gen_google_shopping_condition
''
end
def gen_google_shopping_custom_product
''
end
def gen_google_shopping_custom_label_0
''
end
def gen_google_shopping_custom_label_1
''
end
def gen_google_shopping_custom_label_2
''
end
def gen_google_shopping_custom_label_3
''
end
def gen_google_shopping_custom_label_4
''
end
def gen_variant_image
''
end
def gen_variant_weight_unit
''
end
end