glysellin 0.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +15 -0
- data/MIT-LICENSE +20 -0
- data/README.md +100 -0
- data/Rakefile +29 -0
- data/app/assets/javascripts/glysellin/address.coffee +38 -0
- data/app/assets/javascripts/glysellin/async-cart.coffee +139 -0
- data/app/assets/javascripts/glysellin/base.js +6 -0
- data/app/assets/javascripts/glysellin/cart.coffee +54 -0
- data/app/assets/javascripts/glysellin/main.coffee +0 -0
- data/app/assets/javascripts/glysellin/product.coffee +0 -0
- data/app/assets/stylesheets/glysellin/application.css +13 -0
- data/app/assets/stylesheets/glysellin/orders.css +4 -0
- data/app/assets/stylesheets/glysellin/products.css +4 -0
- data/app/controllers/glysellin/cart/addresses_controller.rb +17 -0
- data/app/controllers/glysellin/cart/discount_code_controller.rb +10 -0
- data/app/controllers/glysellin/cart/payment_method_controller.rb +17 -0
- data/app/controllers/glysellin/cart/products_controller.rb +37 -0
- data/app/controllers/glysellin/cart/shipping_method_controller.rb +18 -0
- data/app/controllers/glysellin/cart/state_controller.rb +15 -0
- data/app/controllers/glysellin/cart_controller.rb +53 -0
- data/app/controllers/glysellin/orders_controller.rb +53 -0
- data/app/controllers/glysellin/products_controller.rb +12 -0
- data/app/helpers/glysellin/application_helper.rb +4 -0
- data/app/helpers/glysellin/cart_helper.rb +21 -0
- data/app/helpers/glysellin/orders_helper.rb +35 -0
- data/app/helpers/glysellin/products_helper.rb +4 -0
- data/app/mailers/glysellin/order_admin_mailer.rb +17 -0
- data/app/mailers/glysellin/order_customer_mailer.rb +27 -0
- data/app/models/glysellin/address.rb +35 -0
- data/app/models/glysellin/brand.rb +14 -0
- data/app/models/glysellin/discount_code.rb +36 -0
- data/app/models/glysellin/discount_type.rb +9 -0
- data/app/models/glysellin/order.rb +243 -0
- data/app/models/glysellin/order_adjustment.rb +19 -0
- data/app/models/glysellin/order_item.rb +38 -0
- data/app/models/glysellin/orderer.rb +28 -0
- data/app/models/glysellin/payment.rb +46 -0
- data/app/models/glysellin/payment_method.rb +36 -0
- data/app/models/glysellin/product.rb +136 -0
- data/app/models/glysellin/product_image.rb +11 -0
- data/app/models/glysellin/product_property.rb +22 -0
- data/app/models/glysellin/product_property_type.rb +11 -0
- data/app/models/glysellin/product_type.rb +11 -0
- data/app/models/glysellin/shipping_method.rb +22 -0
- data/app/models/glysellin/taxonomy.rb +35 -0
- data/app/models/glysellin/variant.rb +100 -0
- data/app/views/glysellin/cart/_added_to_cart_warning.html.erb +21 -0
- data/app/views/glysellin/cart/_cart.html.erb +13 -0
- data/app/views/glysellin/cart/_navigation.html.erb +11 -0
- data/app/views/glysellin/cart/_products.html.erb +125 -0
- data/app/views/glysellin/cart/_recap.html.erb +16 -0
- data/app/views/glysellin/cart/recap/_addresses.html.erb +13 -0
- data/app/views/glysellin/cart/recap/_products.html.erb +63 -0
- data/app/views/glysellin/cart/show.html.erb +13 -0
- data/app/views/glysellin/cart/states/_addresses.html.erb +25 -0
- data/app/views/glysellin/cart/states/_choose_payment_method.html.erb +14 -0
- data/app/views/glysellin/cart/states/_choose_shipping_method.html.erb +14 -0
- data/app/views/glysellin/cart/states/_filled.html.erb +3 -0
- data/app/views/glysellin/cart/states/_init.html.erb +5 -0
- data/app/views/glysellin/cart/states/_ready.html.erb +1 -0
- data/app/views/glysellin/order_admin_mailer/_order_header.text.erb +5 -0
- data/app/views/glysellin/order_admin_mailer/send_check_order_created_email.text.erb +8 -0
- data/app/views/glysellin/order_admin_mailer/send_order_paid_email.text.erb +8 -0
- data/app/views/glysellin/order_customer_mailer/_order_footer.text.erb +3 -0
- data/app/views/glysellin/order_customer_mailer/_order_header.text.erb +5 -0
- data/app/views/glysellin/order_customer_mailer/send_order_created_email.text.erb +7 -0
- data/app/views/glysellin/order_customer_mailer/send_order_paid_email.text.erb +7 -0
- data/app/views/glysellin/order_customer_mailer/send_order_shipped_email.text.erb +8 -0
- data/app/views/glysellin/orders/_addresses_fields.html.erb +29 -0
- data/app/views/glysellin/orders/_order.html.erb +18 -0
- data/app/views/glysellin/orders/_payment_canceled.html.erb +13 -0
- data/app/views/glysellin/orders/_payment_successful.html.erb +6 -0
- data/app/views/glysellin/orders/payment_response.html.erb +5 -0
- data/app/views/glysellin/payment_methods/_paypal-integral.html.erb +22 -0
- data/app/views/glysellin/products/_add_to_cart.html.erb +16 -0
- data/app/views/glysellin/products/_item.html.erb +21 -0
- data/app/views/glysellin/products/filter.html.erb +0 -0
- data/app/views/glysellin/products/index.html.erb +3 -0
- data/app/views/glysellin/products/show.html.erb +3 -0
- data/app/views/glysellin/shared/_address.html.erb +11 -0
- data/app/views/glysellin/shared/_address.text.erb +7 -0
- data/app/views/glysellin/shared/_order.text.erb +56 -0
- data/app/views/glysellin/shared/mailer/_footer.text.erb +2 -0
- data/app/views/layouts/glysellin/application.html.erb +14 -0
- data/config/locales/glysellin.en.yml +113 -0
- data/config/locales/glysellin.fr.yml +119 -0
- data/db/migrate/20120206115004_create_glysellin_orders.rb +16 -0
- data/db/migrate/20120206115132_create_glysellin_customers.rb +8 -0
- data/db/migrate/20120206115657_create_glysellin_addresses.rb +22 -0
- data/db/migrate/20120206124505_create_glysellin_products.rb +20 -0
- data/db/migrate/20120206124545_create_glysellin_order_items.rb +15 -0
- data/db/migrate/20120206124630_create_glysellin_product_images.rb +10 -0
- data/db/migrate/20120206125210_add_attachment_image_to_product_image.rb +15 -0
- data/db/migrate/20120206130920_create_glysellin_payments.rb +13 -0
- data/db/migrate/20120206131042_create_glysellin_payment_methods.rb +10 -0
- data/db/migrate/20120207175050_create_glysellin_taxonomies.rb +11 -0
- data/db/migrate/20120207175158_create_products_taxonomies_table.rb +12 -0
- data/db/migrate/20120515143231_create_brands.rb +9 -0
- data/db/migrate/20120515143233_add_attachment_image_to_brands.rb +15 -0
- data/db/migrate/20120620151705_create_product_properties.rb +12 -0
- data/db/migrate/20130204121211_create_glysellin_discount_types.rb +10 -0
- data/db/migrate/20130204121228_create_glysellin_discount_codes.rb +15 -0
- data/db/migrate/20130204125310_create_glysellin_order_adjustments.rb +13 -0
- data/db/migrate/20130204202102_create_glysellin_shipping_methods.rb +12 -0
- data/db/migrate/20130204202109_add_shipping_method_id_to_glysellin_orders.rb +5 -0
- data/db/migrate/20130205110036_add_weight_to_glysellin_products.rb +5 -0
- data/db/migrate/20130205120541_add_weight_to_glysellin_order_items.rb +5 -0
- data/db/migrate/20130208162813_create_glysellin_variants.rb +17 -0
- data/db/migrate/20130208165020_create_glysellin_product_property_types.rb +7 -0
- data/db/migrate/20130211105557_add_type_id_to_glysellin_product_properties.rb +5 -0
- data/db/migrate/20130211112302_add_variant_id_to_glysellin_product_properties.rb +13 -0
- data/db/migrate/20130211152651_add_product_id_to_glysellin_variants.rb +5 -0
- data/db/migrate/20130212131658_add_weight_to_glysellin_variants.rb +5 -0
- data/db/migrate/20130212132253_remove_variant_columns_from_glysellin_products.rb +15 -0
- data/db/migrate/20130212154943_remove_eot_price_from_glysellin_products.rb +9 -0
- data/db/migrate/20130214184204_create_glysellin_product_types.rb +9 -0
- data/db/migrate/20130214184352_create_product_type_behavior.rb +15 -0
- data/db/migrate/20130221102200_add_unmarked_price_to_glysellin_variants.rb +5 -0
- data/db/migrate/20130311135842_add_addressable_to_glysellin_addresses.rb +6 -0
- data/db/migrate/20130314114048_change_addressable_associations_in_glysellin_addresses.rb +15 -0
- data/db/migrate/20130325113903_remove_address_ids_from_glysellin_orders.rb +11 -0
- data/db/seeds/shipping_carrier/rates/colissimo.csv +16 -0
- data/db/seeds/shipping_carrier/rates/lettre-max.csv +9 -0
- data/lib/active_model/model.rb +101 -0
- data/lib/generators/glysellin/install/USAGE +8 -0
- data/lib/generators/glysellin/install/install_generator.rb +50 -0
- data/lib/generators/glysellin/install/templates/initializer.rb +119 -0
- data/lib/generators/glysellin/install/templates/order_observer.rb +12 -0
- data/lib/generators/glysellin/install/utils.rb +11 -0
- data/lib/glysellin.rb +124 -0
- data/lib/glysellin/acts_as_sellable.rb +14 -0
- data/lib/glysellin/cart.rb +21 -0
- data/lib/glysellin/cart/address.rb +16 -0
- data/lib/glysellin/cart/adjustment.rb +17 -0
- data/lib/glysellin/cart/adjustment/base.rb +41 -0
- data/lib/glysellin/cart/adjustment/discount_code.rb +43 -0
- data/lib/glysellin/cart/adjustment/shipping_method.rb +31 -0
- data/lib/glysellin/cart/basket.rb +482 -0
- data/lib/glysellin/cart/customer.rb +36 -0
- data/lib/glysellin/cart/model_wrapper.rb +90 -0
- data/lib/glysellin/cart/nested_resource.rb +39 -0
- data/lib/glysellin/cart/payment_method.rb +8 -0
- data/lib/glysellin/cart/product.rb +16 -0
- data/lib/glysellin/cart/select.rb +31 -0
- data/lib/glysellin/cart/serializable.rb +30 -0
- data/lib/glysellin/cart/shipping_method.rb +8 -0
- data/lib/glysellin/discount_type_calculator.rb +7 -0
- data/lib/glysellin/discount_type_calculator/base.rb +30 -0
- data/lib/glysellin/discount_type_calculator/order_percentage.rb +16 -0
- data/lib/glysellin/engine.rb +14 -0
- data/lib/glysellin/engine/routes.rb +61 -0
- data/lib/glysellin/gateway.rb +16 -0
- data/lib/glysellin/gateway/atos.rb +111 -0
- data/lib/glysellin/gateway/base.rb +43 -0
- data/lib/glysellin/gateway/check.rb +34 -0
- data/lib/glysellin/gateway/paypal_integral.rb +71 -0
- data/lib/glysellin/helpers.rb +15 -0
- data/lib/glysellin/helpers/controller.rb +22 -0
- data/lib/glysellin/helpers/countries.rb +261 -0
- data/lib/glysellin/helpers/views.rb +28 -0
- data/lib/glysellin/product_methods.rb +66 -0
- data/lib/glysellin/products_list.rb +72 -0
- data/lib/glysellin/property_finder.rb +13 -0
- data/lib/glysellin/shipping_carrier.rb +14 -0
- data/lib/glysellin/shipping_carrier/base.rb +55 -0
- data/lib/glysellin/shipping_carrier/colissimo.rb +19 -0
- data/lib/glysellin/shipping_carrier/flat_rate.rb +19 -0
- data/lib/glysellin/shipping_carrier/free_shipping.rb +14 -0
- data/lib/glysellin/shipping_carrier/helpers/country_weight_table.rb +65 -0
- data/lib/glysellin/shipping_carrier/lettre_max.rb +19 -0
- data/lib/glysellin/version.rb +3 -0
- data/lib/tasks/glysellin_tasks.rake +37 -0
- metadata +341 -0
@@ -0,0 +1,119 @@
|
|
1
|
+
fr:
|
2
|
+
glysellin:
|
3
|
+
controllers:
|
4
|
+
errors:
|
5
|
+
order_doesnt_exist: "Le numéro de commande demandé n'existe pas"
|
6
|
+
double_property: "existe déjà"
|
7
|
+
errors:
|
8
|
+
cart:
|
9
|
+
item_not_for_sale: "Désolé mais le produit %{item} n'est plus disponible"
|
10
|
+
item_out_of_stock: "Désolé mais le produit %{item} n'est plus en stock"
|
11
|
+
not_enough_stock_for_item: "Désolé mais il ne reste que %{stock} %{item} en stock"
|
12
|
+
invalid_discount_code: "Le code promotionnel saisi n'est pas valide"
|
13
|
+
shipping_method_unavailable_for_country: "Désolé mais nous ne pouvons pas envoyer votre commande vers %{country} avec %{method}, merci de choisir un autre mode de livraison"
|
14
|
+
state_transitions:
|
15
|
+
addresses: "Il y a des erreurs dans les informations soumises, merci de vérifier tous les champs"
|
16
|
+
choose_shipping_method: "Merci de choisir un mode de livraison"
|
17
|
+
choose_payment_method: "Merci de choisir un mode de paiement"
|
18
|
+
variant:
|
19
|
+
multiple_properties_with_same_type: "Il y a plusieurs types de propriété identiques pour cette même déclinaison de produit"
|
20
|
+
labels:
|
21
|
+
misc:
|
22
|
+
back_to_homepage: "Retour à l'accueil"
|
23
|
+
back_to_shop: "Retour à la boutique"
|
24
|
+
forms:
|
25
|
+
customer_details: "Votre compte"
|
26
|
+
fill_in_your_address: "Merci de renseigner votre adresse"
|
27
|
+
confirm_addresses: "Confirmer votre adresse"
|
28
|
+
choose_payment_method: "Merci de sélectionner un moyen de paiement"
|
29
|
+
confirm_payment_method: "Confirmer mon moyen de paiement"
|
30
|
+
choose_shipping_method: "Merci de sélectionner un mode de livraison"
|
31
|
+
confirm_shipping_method: "Confirmer mon mode de livraison"
|
32
|
+
customer:
|
33
|
+
sign_in: "Se connecter"
|
34
|
+
sign_up: "Créer un compte"
|
35
|
+
order:
|
36
|
+
billing_address: "Adresse de facturation"
|
37
|
+
shipping_address: "Adresse de livraison"
|
38
|
+
order_summary_title: "Récapitulatif de la commande"
|
39
|
+
your_informations: "Vos informations"
|
40
|
+
your_cart: "Votre panier"
|
41
|
+
order_reference: "Numéro de commande"
|
42
|
+
sku: "SKU"
|
43
|
+
name: "Nom"
|
44
|
+
eot_price: "Prix HT"
|
45
|
+
price: "Prix TTC"
|
46
|
+
subtotal: "Sous-total"
|
47
|
+
shipping: "Frais de port"
|
48
|
+
total: "Total"
|
49
|
+
pay: "Payer"
|
50
|
+
payment: "Paiement"
|
51
|
+
order_title: "Commande"
|
52
|
+
quantity: "Quantité"
|
53
|
+
unit_price: "Prix unitaire"
|
54
|
+
discount_code: "Code promo"
|
55
|
+
paid_on_by: "Payé le %{date} via %{method}"
|
56
|
+
payment_methods:
|
57
|
+
pay_with_paypal: "Payer avec Paypal"
|
58
|
+
check:
|
59
|
+
send_your_check_text: "Votre commande a bien été prise en compte. Merci d'indiquer le numéro de commande suivant : <strong>%{order_ref}</strong> avec votre chèque, de mettre l'ordre à <strong>%{check_order}</strong> et de l'envoyer à l'adresse suivante : <strong>%{check_destination}</strong>"
|
60
|
+
send_your_check_text: "Afin de régler votre commande, merci d'envoyer un chèque à l'addresse suivante <strong>%{check_destination}</strong> et de mettre l'ordre à <strong>%{check_order}</strong>.<br>N'oubliez pas de préciser la référence de commande suivante avec votre chèque : <strong>%{order_ref}</strong>."
|
61
|
+
payment_responses:
|
62
|
+
successfully_paid: "Paiement effectué"
|
63
|
+
successfull_payment_text: "Votre paiement a bien été effectué, votre commande sera traité dans les meilleurs délais, un e-mail de confirmation vous a été envoyé."
|
64
|
+
payment_canceled: "Paiement annulé"
|
65
|
+
canceled_payment_text: "Une erreur s'est produite lors du traitement de votre paiement."
|
66
|
+
try_to_pay_again: "Si vous voulez tenter à nouveau de payer, vous pouvez utiliser le bouton suivant"
|
67
|
+
payments:
|
68
|
+
statuses:
|
69
|
+
pending: "Paiement en attente"
|
70
|
+
paid: "Paiement validé"
|
71
|
+
canceled: "Paiement annulé"
|
72
|
+
methods:
|
73
|
+
paypal_integral: "Paypal"
|
74
|
+
mercanet: "Carte bancaire - Mercanet"
|
75
|
+
sogenactif: "Carte bancaire - Sogenactif"
|
76
|
+
orders:
|
77
|
+
statuses:
|
78
|
+
payment: "Paiement en attente"
|
79
|
+
paid: "Payé"
|
80
|
+
shipping: "Livraison en cours"
|
81
|
+
shipped: "Livré"
|
82
|
+
cart:
|
83
|
+
add_to_cart: "Ajouter au panier"
|
84
|
+
remove_from_cart: "Supprimer"
|
85
|
+
no_products_in_cart: "Pas d'article dans votre panier"
|
86
|
+
products_count: "%{count} articles dans votre panier"
|
87
|
+
your_cart: "Votre panier"
|
88
|
+
create_order: "Passer la commande"
|
89
|
+
create_order_form: "Passer ma commande"
|
90
|
+
back_to_shop: "Retour à la boutique"
|
91
|
+
update: "Mettre à jour le panier"
|
92
|
+
added_to_cart: "Produit ajouté au panier"
|
93
|
+
continue_shopping: "Continuer mes achats"
|
94
|
+
update_discount: "Mettre à jour le code Promo"
|
95
|
+
cancel: "Annuler la commande"
|
96
|
+
products: "Vos produits"
|
97
|
+
informations: "Vos informations"
|
98
|
+
shipping_method: "Mode de livraison"
|
99
|
+
payment_method: "Mode de paiement"
|
100
|
+
orders:
|
101
|
+
states:
|
102
|
+
ready: "Paiement en attente"
|
103
|
+
paid: "Traitement en cours"
|
104
|
+
shipped: "Expédiée"
|
105
|
+
cart:
|
106
|
+
states:
|
107
|
+
filled: "Panier"
|
108
|
+
addresses: "Vos informations"
|
109
|
+
choose_shipping_method: "Choix du mode de livraison"
|
110
|
+
choose_payment_method: "Choix du mode de paiement"
|
111
|
+
ready: "Paiement en attente"
|
112
|
+
mailer:
|
113
|
+
admin:
|
114
|
+
send_order_paid_email: "Une nouvelle commande a été validée sur le site"
|
115
|
+
send_check_order_created_email: "Une commande par chèque a été passée sur le site"
|
116
|
+
customer:
|
117
|
+
send_order_created_email: "Votre commande a bien été validée"
|
118
|
+
send_order_paid_email: "Le paiement de votre commande a été accepté"
|
119
|
+
send_order_shipped_email: "Votre commande a été expédiée"
|
@@ -0,0 +1,16 @@
|
|
1
|
+
class CreateGlysellinOrders < ActiveRecord::Migration
|
2
|
+
def change
|
3
|
+
create_table :glysellin_orders do |t|
|
4
|
+
t.string :ref
|
5
|
+
t.string :status
|
6
|
+
t.datetime :paid_on
|
7
|
+
t.integer :user_id
|
8
|
+
t.integer :billing_address_id
|
9
|
+
t.integer :shipping_address_id
|
10
|
+
t.string :state
|
11
|
+
t.integer :customer_id
|
12
|
+
|
13
|
+
t.timestamps
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
class CreateGlysellinAddresses < ActiveRecord::Migration
|
2
|
+
def change
|
3
|
+
create_table :glysellin_addresses do |t|
|
4
|
+
t.boolean :activated, :default => true
|
5
|
+
t.boolean :company
|
6
|
+
t.string :company_name
|
7
|
+
t.string :vat_number
|
8
|
+
t.string :first_name
|
9
|
+
t.string :last_name
|
10
|
+
t.text :address
|
11
|
+
t.text :address_details
|
12
|
+
t.string :zip
|
13
|
+
t.string :city
|
14
|
+
t.string :country
|
15
|
+
t.string :tel
|
16
|
+
t.string :fax
|
17
|
+
t.text :additional_fields
|
18
|
+
|
19
|
+
t.timestamps
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
class CreateGlysellinProducts < ActiveRecord::Migration
|
2
|
+
def change
|
3
|
+
create_table :glysellin_products do |t|
|
4
|
+
t.string :sku
|
5
|
+
t.string :name
|
6
|
+
t.string :slug
|
7
|
+
t.text :description
|
8
|
+
t.decimal :eot_price, :precision => 11, :scale => 2
|
9
|
+
t.decimal :price, :precision => 11, :scale => 2
|
10
|
+
t.decimal :vat_rate, :precision => 11, :scale => 2
|
11
|
+
t.integer :in_stock, :default => 0
|
12
|
+
t.integer :position, :default => 1
|
13
|
+
t.boolean :unlimited_stock, :default => false
|
14
|
+
t.boolean :published, :default => true
|
15
|
+
t.integer :brand_id
|
16
|
+
|
17
|
+
t.timestamps
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
class CreateGlysellinOrderItems < ActiveRecord::Migration
|
2
|
+
def change
|
3
|
+
create_table :glysellin_order_items do |t|
|
4
|
+
t.string :sku
|
5
|
+
t.string :name
|
6
|
+
t.decimal :eot_price, precision: 11, scale: 2
|
7
|
+
t.decimal :price, precision: 11, scale: 2
|
8
|
+
t.decimal :vat_rate, precision: 11, scale: 2
|
9
|
+
t.integer :quantity
|
10
|
+
t.integer :order_id
|
11
|
+
|
12
|
+
t.timestamps
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
class AddAttachmentImageToProductImage < ActiveRecord::Migration
|
2
|
+
def self.up
|
3
|
+
add_column :glysellin_product_images, :image_file_name, :string
|
4
|
+
add_column :glysellin_product_images, :image_content_type, :string
|
5
|
+
add_column :glysellin_product_images, :image_file_size, :integer
|
6
|
+
add_column :glysellin_product_images, :image_updated_at, :datetime
|
7
|
+
end
|
8
|
+
|
9
|
+
def self.down
|
10
|
+
remove_column :glysellin_product_images, :image_file_name
|
11
|
+
remove_column :glysellin_product_images, :image_content_type
|
12
|
+
remove_column :glysellin_product_images, :image_file_size
|
13
|
+
remove_column :glysellin_product_images, :image_updated_at
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
class CreateGlysellinPayments < ActiveRecord::Migration
|
2
|
+
def change
|
3
|
+
create_table :glysellin_payments do |t|
|
4
|
+
t.string :status
|
5
|
+
t.integer :type_id
|
6
|
+
t.integer :order_id
|
7
|
+
t.datetime :last_payment_action_on
|
8
|
+
t.integer :transaction_id
|
9
|
+
|
10
|
+
t.timestamps
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
class CreateProductsTaxonomiesTable < ActiveRecord::Migration
|
2
|
+
def up
|
3
|
+
create_table :glysellin_products_taxonomies, :id => false do |t|
|
4
|
+
t.integer :product_id
|
5
|
+
t.integer :taxonomy_id
|
6
|
+
end
|
7
|
+
end
|
8
|
+
|
9
|
+
def down
|
10
|
+
drop_table :glysellin_products_taxonomies
|
11
|
+
end
|
12
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
class AddAttachmentImageToBrands < ActiveRecord::Migration
|
2
|
+
def self.up
|
3
|
+
add_column :glysellin_brands, :image_file_name, :string
|
4
|
+
add_column :glysellin_brands, :image_content_type, :string
|
5
|
+
add_column :glysellin_brands, :image_file_size, :integer
|
6
|
+
add_column :glysellin_brands, :image_updated_at, :datetime
|
7
|
+
end
|
8
|
+
|
9
|
+
def self.down
|
10
|
+
remove_column :glysellin_brands, :image_file_name
|
11
|
+
remove_column :glysellin_brands, :image_content_type
|
12
|
+
remove_column :glysellin_brands, :image_file_size
|
13
|
+
remove_column :glysellin_brands, :image_updated_at
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
class CreateProductProperties < ActiveRecord::Migration
|
2
|
+
def change
|
3
|
+
create_table :glysellin_product_properties do |t|
|
4
|
+
t.string :name
|
5
|
+
t.string :value
|
6
|
+
t.decimal :adjustement, precision: 11, scale: 2
|
7
|
+
t.integer :product_id
|
8
|
+
|
9
|
+
t.timestamps
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
class CreateGlysellinDiscountCodes < ActiveRecord::Migration
|
2
|
+
def change
|
3
|
+
create_table :glysellin_discount_codes do |t|
|
4
|
+
t.string :name
|
5
|
+
t.string :code
|
6
|
+
t.integer :discount_type_id
|
7
|
+
t.decimal :value, :precision => 11, :scale => 2
|
8
|
+
t.datetime :expires_on
|
9
|
+
|
10
|
+
t.timestamps
|
11
|
+
end
|
12
|
+
|
13
|
+
add_index :glysellin_discount_codes, :code
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
class CreateGlysellinOrderAdjustments < ActiveRecord::Migration
|
2
|
+
def change
|
3
|
+
create_table :glysellin_order_adjustments do |t|
|
4
|
+
t.string :name
|
5
|
+
t.decimal :value, precision: 11, scale: 2
|
6
|
+
t.integer :order_id
|
7
|
+
t.integer :adjustment_id
|
8
|
+
t.string :adjustment_type
|
9
|
+
|
10
|
+
t.timestamps
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
class CreateGlysellinShippingMethods < ActiveRecord::Migration
|
2
|
+
def change
|
3
|
+
create_table :glysellin_shipping_methods do |t|
|
4
|
+
t.string :name
|
5
|
+
t.string :identifier
|
6
|
+
|
7
|
+
t.timestamps
|
8
|
+
end
|
9
|
+
|
10
|
+
add_index :glysellin_shipping_methods, :identifier
|
11
|
+
end
|
12
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
class CreateGlysellinVariants < ActiveRecord::Migration
|
2
|
+
def change
|
3
|
+
create_table :glysellin_variants do |t|
|
4
|
+
t.string :sku
|
5
|
+
t.string :name
|
6
|
+
t.string :slug
|
7
|
+
t.decimal :eot_price, precision: 11, scale: 2
|
8
|
+
t.decimal :price, precision: 11, scale: 2
|
9
|
+
t.integer :in_stock, default: 0
|
10
|
+
t.boolean :unlimited_stock, default: false
|
11
|
+
t.boolean :published, default: true
|
12
|
+
t.integer :position
|
13
|
+
|
14
|
+
t.timestamps
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|