shoppe 1.0.6 → 1.0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/models/shoppe/product.rb +2 -1
- data/app/models/shoppe/product_category.rb +12 -5
- data/app/views/shoppe/products/import.html.haml +31 -27
- data/config/locales/de.yml +4 -1
- data/config/locales/en.yml +5 -2
- data/config/locales/es.yml +4 -1
- data/config/locales/pl.yml +5 -2
- data/config/locales/pt-BR.yml +5 -2
- data/db/seeds.rb +18 -9
- data/lib/shoppe/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fa73eb9e87ef1d27482822773c0ca8d61f7baea1
|
4
|
+
data.tar.gz: e94359654bfb0ad01f39eaf0ac0638e14c2bac4e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: abffb88a987ab3a8aa34e0ff5da824f89cec0fc7905a1a250cc01b80e95b24eb4735b1fe27aa218845efb03002ab16b540b380734955f5b909f781f4b6c69655
|
7
|
+
data.tar.gz: 9b830ff1d41ff811b183b0aabd62be74b625ccedea233d1034ccb52f0ae2f459e04afe247b9965bd581e301bb29cd788d728c4252c82ddf43b20b7d6242a6c97
|
@@ -116,7 +116,7 @@ module Shoppe
|
|
116
116
|
product_ids = Shoppe::ProductAttribute.searchable.where(:key => key, :value => values).pluck(:product_id).uniq
|
117
117
|
where(:id => product_ids)
|
118
118
|
end
|
119
|
-
|
119
|
+
|
120
120
|
# Imports products from a spreadsheet file
|
121
121
|
# Example:
|
122
122
|
#
|
@@ -144,6 +144,7 @@ module Shoppe
|
|
144
144
|
product.short_description = row["short_description"]
|
145
145
|
product.weight = row["weight"]
|
146
146
|
product.price = row["price"].nil? ? 0 : row["price"]
|
147
|
+
product.permalink = row["permalink"]
|
147
148
|
|
148
149
|
product.product_categories << begin
|
149
150
|
if Shoppe::ProductCategory.find_by(name: row["category_name"]).present?
|
@@ -9,9 +9,9 @@ module Shoppe
|
|
9
9
|
# to a branch in the .gemspec
|
10
10
|
acts_as_nested_set dependent: :restrict_with_exception,
|
11
11
|
after_move: :set_ancestral_permalink
|
12
|
-
|
12
|
+
|
13
13
|
self.table_name = 'shoppe_product_categories'
|
14
|
-
|
14
|
+
|
15
15
|
# Categories have an image attachment
|
16
16
|
attachment :image
|
17
17
|
|
@@ -28,10 +28,10 @@ module Shoppe
|
|
28
28
|
|
29
29
|
# Root (no parent) product categories only
|
30
30
|
scope :without_parent, -> { where(parent_id: nil) }
|
31
|
-
|
31
|
+
|
32
32
|
# No descendents
|
33
33
|
scope :except_descendants, ->(record) { where.not(id: (Array.new(record.descendants) << record).flatten) }
|
34
|
-
|
34
|
+
|
35
35
|
# Set the permalink on callback
|
36
36
|
before_validation :set_permalink, :set_ancestral_permalink
|
37
37
|
after_save :set_child_permalinks
|
@@ -44,6 +44,13 @@ module Shoppe
|
|
44
44
|
end
|
45
45
|
end
|
46
46
|
|
47
|
+
# Return array with all the product category parents hierarchy
|
48
|
+
# in descending order
|
49
|
+
def hierarchy_array
|
50
|
+
return [self] unless parent
|
51
|
+
parent.hierarchy_array.concat [self]
|
52
|
+
end
|
53
|
+
|
47
54
|
private
|
48
55
|
|
49
56
|
def set_permalink
|
@@ -63,6 +70,6 @@ module Shoppe
|
|
63
70
|
category.save! # save forces children to update their ancestral_permalink
|
64
71
|
end
|
65
72
|
end
|
66
|
-
|
73
|
+
|
67
74
|
end
|
68
75
|
end
|
@@ -5,7 +5,7 @@
|
|
5
5
|
|
6
6
|
= form_for "import", :url => import_products_path, :html => {:multipart => true} do |f|
|
7
7
|
= f.error_messages
|
8
|
-
|
8
|
+
|
9
9
|
= field_set_tag t('shoppe.imports.file_upload') do
|
10
10
|
%dl
|
11
11
|
%dt= f.label :import_file, t('shoppe.imports.required_formats')
|
@@ -19,6 +19,7 @@
|
|
19
19
|
%tr
|
20
20
|
%th name
|
21
21
|
%th sku
|
22
|
+
%th permalink
|
22
23
|
%th description
|
23
24
|
%th short_description
|
24
25
|
%th weight
|
@@ -27,37 +28,40 @@
|
|
27
28
|
%th qty
|
28
29
|
%tbody
|
29
30
|
%tr
|
30
|
-
%td= t('shoppe.products.imports.examples.first.name')
|
31
|
-
%td= t('shoppe.products.imports.examples.first.sku')
|
32
|
-
%td= t('shoppe.products.imports.examples.first.
|
33
|
-
%td= t('shoppe.products.imports.examples.first.
|
34
|
-
%td= t('shoppe.products.imports.examples.first.
|
35
|
-
%td= t('shoppe.products.imports.examples.first.
|
36
|
-
%td= t('shoppe.products.imports.examples.first.
|
37
|
-
%td= t('shoppe.products.imports.examples.first.
|
31
|
+
%td= t('shoppe.products.imports.examples.first.name')
|
32
|
+
%td= t('shoppe.products.imports.examples.first.sku')
|
33
|
+
%td= t('shoppe.products.imports.examples.first.permalink')
|
34
|
+
%td= t('shoppe.products.imports.examples.first.description')
|
35
|
+
%td= t('shoppe.products.imports.examples.first.short_description')
|
36
|
+
%td= t('shoppe.products.imports.examples.first.weight')
|
37
|
+
%td= t('shoppe.products.imports.examples.first.price')
|
38
|
+
%td= t('shoppe.products.imports.examples.first.category_name')
|
39
|
+
%td= t('shoppe.products.imports.examples.first.qty')
|
38
40
|
%tr
|
39
|
-
%td= t('shoppe.products.imports.examples.second.name')
|
40
|
-
%td= t('shoppe.products.imports.examples.second.sku')
|
41
|
-
%td= t('shoppe.products.imports.examples.second.
|
42
|
-
%td= t('shoppe.products.imports.examples.second.
|
43
|
-
%td= t('shoppe.products.imports.examples.second.
|
44
|
-
%td= t('shoppe.products.imports.examples.second.
|
45
|
-
%td= t('shoppe.products.imports.examples.second.
|
46
|
-
%td= t('shoppe.products.imports.examples.second.
|
41
|
+
%td= t('shoppe.products.imports.examples.second.name')
|
42
|
+
%td= t('shoppe.products.imports.examples.second.sku')
|
43
|
+
%td= t('shoppe.products.imports.examples.second.permalink')
|
44
|
+
%td= t('shoppe.products.imports.examples.second.description')
|
45
|
+
%td= t('shoppe.products.imports.examples.second.short_description')
|
46
|
+
%td= t('shoppe.products.imports.examples.second.weight')
|
47
|
+
%td= t('shoppe.products.imports.examples.second.price')
|
48
|
+
%td= t('shoppe.products.imports.examples.second.category_name')
|
49
|
+
%td= t('shoppe.products.imports.examples.second.qty')
|
47
50
|
%tr
|
48
|
-
%td= t('shoppe.products.imports.examples.third.name')
|
49
|
-
%td= t('shoppe.products.imports.examples.third.sku')
|
50
|
-
%td= t('shoppe.products.imports.examples.third.
|
51
|
-
%td= t('shoppe.products.imports.examples.third.
|
52
|
-
%td= t('shoppe.products.imports.examples.third.
|
53
|
-
%td= t('shoppe.products.imports.examples.third.
|
54
|
-
%td= t('shoppe.products.imports.examples.third.
|
55
|
-
%td= t('shoppe.products.imports.examples.third.
|
51
|
+
%td= t('shoppe.products.imports.examples.third.name')
|
52
|
+
%td= t('shoppe.products.imports.examples.third.sku')
|
53
|
+
%td= t('shoppe.products.imports.examples.third.permalink')
|
54
|
+
%td= t('shoppe.products.imports.examples.third.description')
|
55
|
+
%td= t('shoppe.products.imports.examples.third.short_description')
|
56
|
+
%td= t('shoppe.products.imports.examples.third.weight')
|
57
|
+
%td= t('shoppe.products.imports.examples.third.price')
|
58
|
+
%td= t('shoppe.products.imports.examples.third.category_name')
|
59
|
+
%td= t('shoppe.products.imports.examples.third.qty')
|
56
60
|
%tr.tear-off
|
57
61
|
%td{:colspan => "8"}
|
58
62
|
%dd
|
59
|
-
%p.help= t('shoppe.products.imports.help')
|
63
|
+
%p.help= t('shoppe.products.imports.help')
|
60
64
|
|
61
65
|
%p.submit
|
62
66
|
= f.submit t('shoppe.import'), :class => "button green"
|
63
|
-
= link_to t('shoppe.cancel'), :products, :class => "button"
|
67
|
+
= link_to t('shoppe.cancel'), :products, :class => "button"
|
data/config/locales/de.yml
CHANGED
@@ -446,12 +446,13 @@ de:
|
|
446
446
|
weight: Gewicht
|
447
447
|
|
448
448
|
imports:
|
449
|
-
help: Produkte und Kategorien werden nach Namen gematcht. Wird kein Produkt gefunden wird ein neues mit allen Attributen angelegt. Wird ein Produkt gefunden, wird nur die Anzahl erhöht. Wird keine Kategorie gefunden, wird diese angelegt. Ein Produkt pro Zeile.
|
449
|
+
help: Produkte und Kategorien werden nach Namen gematcht. Wird kein Produkt gefunden wird ein neues mit allen Attributen angelegt. Wird ein Produkt gefunden, wird nur die Anzahl erhöht. Wird keine Kategorie gefunden, wird diese angelegt. Ein Produkt pro Zeile. Sie können permalink Feld leer lassen, wenn Sie nicht wollen, um eine hinzuzufügen und automatisch generiert werden.
|
450
450
|
success: Produkte wurden erfolgreich imnportiert
|
451
451
|
examples:
|
452
452
|
first:
|
453
453
|
name: Plüschbär
|
454
454
|
sku: BAER001
|
455
|
+
permalink: plush-teddy-bear
|
455
456
|
description: Sehr plüschig. Für alle Altersgruppen geeignet.
|
456
457
|
short_description: Kaufen Sie ihn für Ihre Kinder.
|
457
458
|
weight: 1.2
|
@@ -461,6 +462,7 @@ de:
|
|
461
462
|
second:
|
462
463
|
name: Standard Teddybär
|
463
464
|
sku: BAER002
|
465
|
+
permalink: ""
|
464
466
|
description: Hergestellt aus PVC.
|
465
467
|
short_description: Kaufen Sie diesen für Personen mit zwei linken Händen.
|
466
468
|
weight: 0.6
|
@@ -470,6 +472,7 @@ de:
|
|
470
472
|
third:
|
471
473
|
name: Teddybär
|
472
474
|
sku: BAER003
|
475
|
+
permalink: stick-teddy-bear
|
473
476
|
description: Sehr natürlich. Feuerrisiko.
|
474
477
|
short_description: Kaufen Sie diesen für diese entfernte Tante, die Teddybären sammelt.
|
475
478
|
weight: 0.521
|
data/config/locales/en.yml
CHANGED
@@ -455,13 +455,14 @@ en:
|
|
455
455
|
website_properties: Website Properties
|
456
456
|
weight: Weight
|
457
457
|
|
458
|
-
imports:
|
459
|
-
help: Products and Categories are matched by name. If no product is found, a new one will be created with all the attributes on the line. If a product is found, only the quantity will be updated and all other fields will be ignored. If no category is found, one with that name will be created . One product per line.
|
458
|
+
imports:
|
459
|
+
help: Products and Categories are matched by name. If no product is found, a new one will be created with all the attributes on the line. If a product is found, only the quantity will be updated and all other fields will be ignored. If no category is found, one with that name will be created . One product per line. You can leave permalink field empty if you don't want to add one and to be generated automatically.
|
460
460
|
success: Products imported successfully
|
461
461
|
examples:
|
462
462
|
first:
|
463
463
|
name: Plush Teddy Bear
|
464
464
|
sku: BEAR001
|
465
|
+
permalink: plush-teddy-bear
|
465
466
|
description: Fantastically plush. Very cuddly. Great for all ages.
|
466
467
|
short_description: Buy this for your kids.
|
467
468
|
weight: 1.2
|
@@ -471,6 +472,7 @@ en:
|
|
471
472
|
second:
|
472
473
|
name: Standard Teddy Bear
|
473
474
|
sku: BEAR002
|
475
|
+
permalink: ""
|
474
476
|
description: Made out of PVC. A little cuddly. Spill resistant.
|
475
477
|
short_description: Buy this for those with two left thumbs.
|
476
478
|
weight: 0.6
|
@@ -480,6 +482,7 @@ en:
|
|
480
482
|
third:
|
481
483
|
name: Stick Teddy Bear
|
482
484
|
sku: BEAR003
|
485
|
+
permalink: stick-teddy-bear
|
483
486
|
description: Made out of sticks. Not really cuddly. All natural. Fire hazard.
|
484
487
|
short_description: Buy this for that distant aunt who collects bears.
|
485
488
|
weight: 0.521
|
data/config/locales/es.yml
CHANGED
@@ -446,12 +446,13 @@ es:
|
|
446
446
|
weight: Peso
|
447
447
|
|
448
448
|
imports:
|
449
|
-
help: Productos y cateogorías son emparejados por nombre. Si no se encuentra un producto, uno nuevo será creados con los atributos de la línea. Si el producto es encontrado, sólo la cantidad será actualizada y el resto de los campos serán ignorados. Si no se encuentra la categoría, se creará una nueva con el nombre indicado. Un producto por línea.
|
449
|
+
help: Productos y cateogorías son emparejados por nombre. Si no se encuentra un producto, uno nuevo será creados con los atributos de la línea. Si el producto es encontrado, sólo la cantidad será actualizada y el resto de los campos serán ignorados. Si no se encuentra la categoría, se creará una nueva con el nombre indicado. Un producto por línea. Puede dejar el campo permalink vacía si no quieres añadir uno y que se genere de forma automática.
|
450
450
|
success: Productos importados satisfactoriamente
|
451
451
|
examples:
|
452
452
|
first:
|
453
453
|
name: Osito de peluche
|
454
454
|
sku: BEAR001
|
455
|
+
permalink: plush-teddy-bear
|
455
456
|
description: Fantásticamente de peluche. Muy mimoso. Grandioso para todas las edades.
|
456
457
|
short_description: Cómprelo para sus niños.
|
457
458
|
weight: 1.2
|
@@ -461,6 +462,7 @@ es:
|
|
461
462
|
second:
|
462
463
|
name: Oso de peluche Standard
|
463
464
|
sku: BEAR002
|
465
|
+
permalink: ""
|
464
466
|
description: Hecho de PVC. Un poco mimoso. Resistente a derrames.
|
465
467
|
short_description: Cómprelo para aquellos con dos pulgares izquierdos.
|
466
468
|
weight: 0.6
|
@@ -470,6 +472,7 @@ es:
|
|
470
472
|
third:
|
471
473
|
name: Oso de madera
|
472
474
|
sku: BEAR003
|
475
|
+
permalink: stick-teddy-bear
|
473
476
|
description: hecho de palitos. No exactamente mimoso. Todo natural. Peligro de inflamación.
|
474
477
|
short_description: Cómprelo para aquella tía lejana que colecciona osos.
|
475
478
|
weight: 0.521
|
data/config/locales/pl.yml
CHANGED
@@ -460,13 +460,14 @@ pl:
|
|
460
460
|
website_properties: Właściwości strony
|
461
461
|
weight: Waga
|
462
462
|
|
463
|
-
imports:
|
464
|
-
help: Products and Categories are matched by name. If no product is found, a new one will be created with all the attributes on the line. If a product is found, only the quantity will be updated and all other fields will be ignored. If no category is found, one with that name will be created . One product per line.
|
463
|
+
imports:
|
464
|
+
help: Products and Categories are matched by name. If no product is found, a new one will be created with all the attributes on the line. If a product is found, only the quantity will be updated and all other fields will be ignored. If no category is found, one with that name will be created . One product per line. Możesz zostawić pole permalink puste, jeśli nie chcesz, aby dodać jeden i być generowane automatycznie.
|
465
465
|
success: Produkty importowane z powodzeniem
|
466
466
|
examples:
|
467
467
|
first:
|
468
468
|
name: Plush Teddy Bear
|
469
469
|
sku: BEAR001
|
470
|
+
permalink: plush-teddy-bear
|
470
471
|
description: Fantastically plush. Very cuddly. Great for all ages.
|
471
472
|
short_description: Buy this for your kids.
|
472
473
|
weight: 1.2
|
@@ -476,6 +477,7 @@ pl:
|
|
476
477
|
second:
|
477
478
|
name: Standard Teddy Bear
|
478
479
|
sku: BEAR002
|
480
|
+
permalink: ""
|
479
481
|
description: Made out of PVC. A little cuddly. Spill resistant.
|
480
482
|
short_description: Buy this for those with two left thumbs.
|
481
483
|
weight: 0.6
|
@@ -485,6 +487,7 @@ pl:
|
|
485
487
|
third:
|
486
488
|
name: Stick Teddy Bear
|
487
489
|
sku: BEAR003
|
490
|
+
permalink: stick-teddy-bear
|
488
491
|
description: Made out of sticks. Not really cuddly. All natural. Fire hazard.
|
489
492
|
short_description: Buy this for that distant aunt who collects bears.
|
490
493
|
weight: 0.521
|
data/config/locales/pt-BR.yml
CHANGED
@@ -447,13 +447,14 @@ pt-BR:
|
|
447
447
|
website_properties: Propriedades do Site
|
448
448
|
weight: Peso
|
449
449
|
|
450
|
-
imports:
|
451
|
-
help: Products and Categories are matched by name. If no product is found, a new one will be created with all the attributes on the line. If a product is found, only the quantity will be updated and all other fields will be ignored. If no category is found, one with that name will be created . One product per line.
|
450
|
+
imports:
|
451
|
+
help: Products and Categories are matched by name. If no product is found, a new one will be created with all the attributes on the line. If a product is found, only the quantity will be updated and all other fields will be ignored. If no category is found, one with that name will be created . One product per line. Você pode deixar permalink campo vazio se você não quiser adicionar um e para ser gerado automaticamente.
|
452
452
|
success: Produtos importados com sucesso
|
453
453
|
examples:
|
454
454
|
first:
|
455
455
|
name: Plush Teddy Bear
|
456
456
|
sku: BEAR001
|
457
|
+
permalink: plush-teddy-bear
|
457
458
|
description: Fantastically plush. Very cuddly. Great for all ages.
|
458
459
|
short_description: Buy this for your kids.
|
459
460
|
weight: 1.2
|
@@ -463,6 +464,7 @@ pt-BR:
|
|
463
464
|
second:
|
464
465
|
name: Standard Teddy Bear
|
465
466
|
sku: BEAR002
|
467
|
+
permalink: ""
|
466
468
|
description: Made out of PVC. A little cuddly. Spill resistant.
|
467
469
|
short_description: Buy this for those with two left thumbs.
|
468
470
|
weight: 0.6
|
@@ -472,6 +474,7 @@ pt-BR:
|
|
472
474
|
third:
|
473
475
|
name: Stick Teddy Bear
|
474
476
|
sku: BEAR003
|
477
|
+
permalink: stick-teddy-bear
|
475
478
|
description: Made out of sticks. Not really cuddly. All natural. Fire hazard.
|
476
479
|
short_description: Buy this for that distant aunt who collects bears.
|
477
480
|
weight: 0.521
|
data/db/seeds.rb
CHANGED
@@ -30,7 +30,8 @@ end
|
|
30
30
|
|
31
31
|
lorem = 'Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.'
|
32
32
|
|
33
|
-
pro =
|
33
|
+
pro = Shoppe::Product.new(:name => 'Yealink T20P', :sku => 'YL-SIP-T20P', :description => lorem, :short_description => 'If cheap & cheerful is what you’re after, the Yealink T20P is what you’re looking for.', :weight => 1.119, :price => 54.99, :cost_price => 44.99, :tax_rate => tax_rate, :featured => true)
|
34
|
+
pro.product_category_ids = cat1.id
|
34
35
|
pro.default_image_file = get_file('t20p.jpg')
|
35
36
|
pro.save!
|
36
37
|
pro.stock_level_adjustments.create(:description => 'Initial Stock', :adjustment => 17)
|
@@ -41,7 +42,8 @@ pro.product_attributes.create!(:key => 'Lines', :value => '3', :position => 1)
|
|
41
42
|
pro.product_attributes.create!(:key => 'Colour Screen?', :value => 'No', :position => 1)
|
42
43
|
pro.product_attributes.create!(:key => 'Power over ethernet?', :value => 'Yes', :position => 1)
|
43
44
|
|
44
|
-
pro =
|
45
|
+
pro = Shoppe::Product.new(:name => 'Yealink T22P', :sku => 'YL-SIP-T22P', :description => lorem, :short_description => lorem, :weight => 1.419, :price => 64.99, :cost_price => 56.99, :tax_rate => tax_rate)
|
46
|
+
pro.product_category_ids = cat1.id
|
45
47
|
pro.default_image_file = get_file('t22p.jpg')
|
46
48
|
pro.save!
|
47
49
|
pro.stock_level_adjustments.create(:description => 'Initial Stock', :adjustment => 200)
|
@@ -53,7 +55,8 @@ pro.product_attributes.create!(:key => 'Colour Screen?', :value => 'No', :positi
|
|
53
55
|
pro.product_attributes.create!(:key => 'Power over ethernet?', :value => 'Yes', :position => 1)
|
54
56
|
|
55
57
|
|
56
|
-
pro =
|
58
|
+
pro = Shoppe::Product.new(:name => 'Yealink T26P', :sku => 'YL-SIP-T26P', :description => lorem, :short_description => lorem, :weight => 2.23, :price => 88.99, :cost_price => 78.99, :tax_rate => tax_rate)
|
59
|
+
pro.product_category_ids = cat1.id
|
57
60
|
pro.default_image_file = get_file('t26p.jpg')
|
58
61
|
pro.save!
|
59
62
|
pro.stock_level_adjustments.create(:description => 'Initial Stock', :adjustment => 100)
|
@@ -64,7 +67,8 @@ pro.product_attributes.create!(:key => 'Lines', :value => '6', :position => 1)
|
|
64
67
|
pro.product_attributes.create!(:key => 'Colour Screen?', :value => 'No', :position => 1)
|
65
68
|
pro.product_attributes.create!(:key => 'Power over ethernet?', :value => 'Yes', :position => 1)
|
66
69
|
|
67
|
-
pro =
|
70
|
+
pro = Shoppe::Product.new(:name => 'Yealink T46GN', :sku => 'YL-SIP-T46GN', :description => lorem, :short_description => 'Colourful, sharp, fast & down right sexy. The Yealink T46P will make your scream!', :weight => 2.23, :price => 149.99, :cost_price => 139.99, :tax_rate => tax_rate, :featured => true)
|
71
|
+
pro.product_category_ids = cat1.id
|
68
72
|
pro.default_image_file = get_file('t46gn.jpg')
|
69
73
|
pro.save!
|
70
74
|
pro.stock_level_adjustments.create(:description => 'Initial Stock', :adjustment => 10)
|
@@ -75,7 +79,8 @@ pro.product_attributes.create!(:key => 'Lines', :value => '4', :position => 1)
|
|
75
79
|
pro.product_attributes.create!(:key => 'Colour Screen?', :value => 'Yes', :position => 1)
|
76
80
|
pro.product_attributes.create!(:key => 'Power over ethernet?', :value => 'Yes', :position => 1)
|
77
81
|
|
78
|
-
pro =
|
82
|
+
pro = Shoppe::Product.new(:name => 'Snom 870', :sku => 'SM-870', :description => lorem, :short_description => 'The perfect & beautiful VoIP phone for the discerning professional desk.', :featured => true)
|
83
|
+
pro.product_category_ids = cat1.id
|
79
84
|
pro.default_image_file = get_file('snom-870-grey.jpg')
|
80
85
|
pro.save!
|
81
86
|
pro.product_attributes.create!(:key => 'Manufacturer', :value => 'Snom', :position => 1)
|
@@ -97,27 +102,31 @@ v2.save!
|
|
97
102
|
v2.stock_level_adjustments.create(:description => 'Initial Stock', :adjustment => 2)
|
98
103
|
|
99
104
|
|
100
|
-
pro =
|
105
|
+
pro = Shoppe::Product.new(:name => 'Yealink Mono Headset', :sku => 'YL-YHS32', :description => lorem, :short_description => 'If you\'re often on the phone, this headset will make your life 100x easier. Guaranteed*.', :weight => 0.890, :price => 34.99, :cost_price => 24.99, :tax_rate => tax_rate, :featured => true)
|
106
|
+
pro.product_category_ids = cat2.id
|
101
107
|
pro.default_image_file = get_file('yhs32.jpg')
|
102
108
|
pro.save!
|
103
109
|
pro.product_attributes.create!(:key => 'Manufacturer', :value => 'Yealink', :position => 1)
|
104
110
|
pro.product_attributes.create!(:key => 'Model', :value => 'YHS32', :position => 1)
|
105
111
|
|
106
|
-
pro =
|
112
|
+
pro = Shoppe::Product.new(:name => 'Snom Wired Headset (MM2)', :sku => 'SM-MM2', :description => lorem, :short_description => lorem, :weight => 0.780, :price => 38.00, :cost_price => 30, :tax_rate => tax_rate)
|
113
|
+
pro.product_category_ids = cat2.id
|
107
114
|
pro.default_image_file = get_file('snom-mm2.jpg')
|
108
115
|
pro.save!
|
109
116
|
pro.stock_level_adjustments.create(:description => 'Initial Stock', :adjustment => 7)
|
110
117
|
pro.product_attributes.create!(:key => 'Manufacturer', :value => 'Snom', :position => 1)
|
111
118
|
pro.product_attributes.create!(:key => 'Model', :value => 'MM2', :position => 1)
|
112
119
|
|
113
|
-
pro =
|
120
|
+
pro = Shoppe::Product.new(:name => 'Snom Wired Headset (MM3)', :sku => 'SM-MM3', :description => lorem, :short_description => lorem, :weight => 0.780, :price => 38.00, :cost_price => 30, :tax_rate => tax_rate)
|
121
|
+
pro.product_category_ids = cat2.id
|
114
122
|
pro.default_image_file = get_file('snom-mm2.jpg')
|
115
123
|
pro.save!
|
116
124
|
pro.stock_level_adjustments.create(:description => 'Initial Stock', :adjustment => 5)
|
117
125
|
pro.product_attributes.create!(:key => 'Manufacturer', :value => 'Snom', :position => 1)
|
118
126
|
pro.product_attributes.create!(:key => 'Model', :value => 'MM3', :position => 1)
|
119
127
|
|
120
|
-
pro =
|
128
|
+
pro = Shoppe::Product.new(:name => 'Yealink W52P', :sku => 'TL-SIP-W52P', :description => lorem, :short_description => 'Wireless SIP phones are hard to come by but this beauty from Yealink is fab.', :weight => 1.280, :price => 99.99, :cost_price => 89.99, :tax_rate => tax_rate, :featured => true)
|
129
|
+
pro.product_category_ids = cat1.id
|
121
130
|
pro.default_image_file = get_file('w52p.jpg')
|
122
131
|
pro.save!
|
123
132
|
pro.stock_level_adjustments.create(:description => 'Initial Stock', :adjustment => 10)
|
data/lib/shoppe/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: shoppe
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Adam Cooke
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-05-
|
11
|
+
date: 2015-05-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|