glysellin 0.4.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (173) hide show
  1. checksums.yaml +15 -0
  2. data/MIT-LICENSE +20 -0
  3. data/README.md +100 -0
  4. data/Rakefile +29 -0
  5. data/app/assets/javascripts/glysellin/address.coffee +38 -0
  6. data/app/assets/javascripts/glysellin/async-cart.coffee +139 -0
  7. data/app/assets/javascripts/glysellin/base.js +6 -0
  8. data/app/assets/javascripts/glysellin/cart.coffee +54 -0
  9. data/app/assets/javascripts/glysellin/main.coffee +0 -0
  10. data/app/assets/javascripts/glysellin/product.coffee +0 -0
  11. data/app/assets/stylesheets/glysellin/application.css +13 -0
  12. data/app/assets/stylesheets/glysellin/orders.css +4 -0
  13. data/app/assets/stylesheets/glysellin/products.css +4 -0
  14. data/app/controllers/glysellin/cart/addresses_controller.rb +17 -0
  15. data/app/controllers/glysellin/cart/discount_code_controller.rb +10 -0
  16. data/app/controllers/glysellin/cart/payment_method_controller.rb +17 -0
  17. data/app/controllers/glysellin/cart/products_controller.rb +37 -0
  18. data/app/controllers/glysellin/cart/shipping_method_controller.rb +18 -0
  19. data/app/controllers/glysellin/cart/state_controller.rb +15 -0
  20. data/app/controllers/glysellin/cart_controller.rb +53 -0
  21. data/app/controllers/glysellin/orders_controller.rb +53 -0
  22. data/app/controllers/glysellin/products_controller.rb +12 -0
  23. data/app/helpers/glysellin/application_helper.rb +4 -0
  24. data/app/helpers/glysellin/cart_helper.rb +21 -0
  25. data/app/helpers/glysellin/orders_helper.rb +35 -0
  26. data/app/helpers/glysellin/products_helper.rb +4 -0
  27. data/app/mailers/glysellin/order_admin_mailer.rb +17 -0
  28. data/app/mailers/glysellin/order_customer_mailer.rb +27 -0
  29. data/app/models/glysellin/address.rb +35 -0
  30. data/app/models/glysellin/brand.rb +14 -0
  31. data/app/models/glysellin/discount_code.rb +36 -0
  32. data/app/models/glysellin/discount_type.rb +9 -0
  33. data/app/models/glysellin/order.rb +243 -0
  34. data/app/models/glysellin/order_adjustment.rb +19 -0
  35. data/app/models/glysellin/order_item.rb +38 -0
  36. data/app/models/glysellin/orderer.rb +28 -0
  37. data/app/models/glysellin/payment.rb +46 -0
  38. data/app/models/glysellin/payment_method.rb +36 -0
  39. data/app/models/glysellin/product.rb +136 -0
  40. data/app/models/glysellin/product_image.rb +11 -0
  41. data/app/models/glysellin/product_property.rb +22 -0
  42. data/app/models/glysellin/product_property_type.rb +11 -0
  43. data/app/models/glysellin/product_type.rb +11 -0
  44. data/app/models/glysellin/shipping_method.rb +22 -0
  45. data/app/models/glysellin/taxonomy.rb +35 -0
  46. data/app/models/glysellin/variant.rb +100 -0
  47. data/app/views/glysellin/cart/_added_to_cart_warning.html.erb +21 -0
  48. data/app/views/glysellin/cart/_cart.html.erb +13 -0
  49. data/app/views/glysellin/cart/_navigation.html.erb +11 -0
  50. data/app/views/glysellin/cart/_products.html.erb +125 -0
  51. data/app/views/glysellin/cart/_recap.html.erb +16 -0
  52. data/app/views/glysellin/cart/recap/_addresses.html.erb +13 -0
  53. data/app/views/glysellin/cart/recap/_products.html.erb +63 -0
  54. data/app/views/glysellin/cart/show.html.erb +13 -0
  55. data/app/views/glysellin/cart/states/_addresses.html.erb +25 -0
  56. data/app/views/glysellin/cart/states/_choose_payment_method.html.erb +14 -0
  57. data/app/views/glysellin/cart/states/_choose_shipping_method.html.erb +14 -0
  58. data/app/views/glysellin/cart/states/_filled.html.erb +3 -0
  59. data/app/views/glysellin/cart/states/_init.html.erb +5 -0
  60. data/app/views/glysellin/cart/states/_ready.html.erb +1 -0
  61. data/app/views/glysellin/order_admin_mailer/_order_header.text.erb +5 -0
  62. data/app/views/glysellin/order_admin_mailer/send_check_order_created_email.text.erb +8 -0
  63. data/app/views/glysellin/order_admin_mailer/send_order_paid_email.text.erb +8 -0
  64. data/app/views/glysellin/order_customer_mailer/_order_footer.text.erb +3 -0
  65. data/app/views/glysellin/order_customer_mailer/_order_header.text.erb +5 -0
  66. data/app/views/glysellin/order_customer_mailer/send_order_created_email.text.erb +7 -0
  67. data/app/views/glysellin/order_customer_mailer/send_order_paid_email.text.erb +7 -0
  68. data/app/views/glysellin/order_customer_mailer/send_order_shipped_email.text.erb +8 -0
  69. data/app/views/glysellin/orders/_addresses_fields.html.erb +29 -0
  70. data/app/views/glysellin/orders/_order.html.erb +18 -0
  71. data/app/views/glysellin/orders/_payment_canceled.html.erb +13 -0
  72. data/app/views/glysellin/orders/_payment_successful.html.erb +6 -0
  73. data/app/views/glysellin/orders/payment_response.html.erb +5 -0
  74. data/app/views/glysellin/payment_methods/_paypal-integral.html.erb +22 -0
  75. data/app/views/glysellin/products/_add_to_cart.html.erb +16 -0
  76. data/app/views/glysellin/products/_item.html.erb +21 -0
  77. data/app/views/glysellin/products/filter.html.erb +0 -0
  78. data/app/views/glysellin/products/index.html.erb +3 -0
  79. data/app/views/glysellin/products/show.html.erb +3 -0
  80. data/app/views/glysellin/shared/_address.html.erb +11 -0
  81. data/app/views/glysellin/shared/_address.text.erb +7 -0
  82. data/app/views/glysellin/shared/_order.text.erb +56 -0
  83. data/app/views/glysellin/shared/mailer/_footer.text.erb +2 -0
  84. data/app/views/layouts/glysellin/application.html.erb +14 -0
  85. data/config/locales/glysellin.en.yml +113 -0
  86. data/config/locales/glysellin.fr.yml +119 -0
  87. data/db/migrate/20120206115004_create_glysellin_orders.rb +16 -0
  88. data/db/migrate/20120206115132_create_glysellin_customers.rb +8 -0
  89. data/db/migrate/20120206115657_create_glysellin_addresses.rb +22 -0
  90. data/db/migrate/20120206124505_create_glysellin_products.rb +20 -0
  91. data/db/migrate/20120206124545_create_glysellin_order_items.rb +15 -0
  92. data/db/migrate/20120206124630_create_glysellin_product_images.rb +10 -0
  93. data/db/migrate/20120206125210_add_attachment_image_to_product_image.rb +15 -0
  94. data/db/migrate/20120206130920_create_glysellin_payments.rb +13 -0
  95. data/db/migrate/20120206131042_create_glysellin_payment_methods.rb +10 -0
  96. data/db/migrate/20120207175050_create_glysellin_taxonomies.rb +11 -0
  97. data/db/migrate/20120207175158_create_products_taxonomies_table.rb +12 -0
  98. data/db/migrate/20120515143231_create_brands.rb +9 -0
  99. data/db/migrate/20120515143233_add_attachment_image_to_brands.rb +15 -0
  100. data/db/migrate/20120620151705_create_product_properties.rb +12 -0
  101. data/db/migrate/20130204121211_create_glysellin_discount_types.rb +10 -0
  102. data/db/migrate/20130204121228_create_glysellin_discount_codes.rb +15 -0
  103. data/db/migrate/20130204125310_create_glysellin_order_adjustments.rb +13 -0
  104. data/db/migrate/20130204202102_create_glysellin_shipping_methods.rb +12 -0
  105. data/db/migrate/20130204202109_add_shipping_method_id_to_glysellin_orders.rb +5 -0
  106. data/db/migrate/20130205110036_add_weight_to_glysellin_products.rb +5 -0
  107. data/db/migrate/20130205120541_add_weight_to_glysellin_order_items.rb +5 -0
  108. data/db/migrate/20130208162813_create_glysellin_variants.rb +17 -0
  109. data/db/migrate/20130208165020_create_glysellin_product_property_types.rb +7 -0
  110. data/db/migrate/20130211105557_add_type_id_to_glysellin_product_properties.rb +5 -0
  111. data/db/migrate/20130211112302_add_variant_id_to_glysellin_product_properties.rb +13 -0
  112. data/db/migrate/20130211152651_add_product_id_to_glysellin_variants.rb +5 -0
  113. data/db/migrate/20130212131658_add_weight_to_glysellin_variants.rb +5 -0
  114. data/db/migrate/20130212132253_remove_variant_columns_from_glysellin_products.rb +15 -0
  115. data/db/migrate/20130212154943_remove_eot_price_from_glysellin_products.rb +9 -0
  116. data/db/migrate/20130214184204_create_glysellin_product_types.rb +9 -0
  117. data/db/migrate/20130214184352_create_product_type_behavior.rb +15 -0
  118. data/db/migrate/20130221102200_add_unmarked_price_to_glysellin_variants.rb +5 -0
  119. data/db/migrate/20130311135842_add_addressable_to_glysellin_addresses.rb +6 -0
  120. data/db/migrate/20130314114048_change_addressable_associations_in_glysellin_addresses.rb +15 -0
  121. data/db/migrate/20130325113903_remove_address_ids_from_glysellin_orders.rb +11 -0
  122. data/db/seeds/shipping_carrier/rates/colissimo.csv +16 -0
  123. data/db/seeds/shipping_carrier/rates/lettre-max.csv +9 -0
  124. data/lib/active_model/model.rb +101 -0
  125. data/lib/generators/glysellin/install/USAGE +8 -0
  126. data/lib/generators/glysellin/install/install_generator.rb +50 -0
  127. data/lib/generators/glysellin/install/templates/initializer.rb +119 -0
  128. data/lib/generators/glysellin/install/templates/order_observer.rb +12 -0
  129. data/lib/generators/glysellin/install/utils.rb +11 -0
  130. data/lib/glysellin.rb +124 -0
  131. data/lib/glysellin/acts_as_sellable.rb +14 -0
  132. data/lib/glysellin/cart.rb +21 -0
  133. data/lib/glysellin/cart/address.rb +16 -0
  134. data/lib/glysellin/cart/adjustment.rb +17 -0
  135. data/lib/glysellin/cart/adjustment/base.rb +41 -0
  136. data/lib/glysellin/cart/adjustment/discount_code.rb +43 -0
  137. data/lib/glysellin/cart/adjustment/shipping_method.rb +31 -0
  138. data/lib/glysellin/cart/basket.rb +482 -0
  139. data/lib/glysellin/cart/customer.rb +36 -0
  140. data/lib/glysellin/cart/model_wrapper.rb +90 -0
  141. data/lib/glysellin/cart/nested_resource.rb +39 -0
  142. data/lib/glysellin/cart/payment_method.rb +8 -0
  143. data/lib/glysellin/cart/product.rb +16 -0
  144. data/lib/glysellin/cart/select.rb +31 -0
  145. data/lib/glysellin/cart/serializable.rb +30 -0
  146. data/lib/glysellin/cart/shipping_method.rb +8 -0
  147. data/lib/glysellin/discount_type_calculator.rb +7 -0
  148. data/lib/glysellin/discount_type_calculator/base.rb +30 -0
  149. data/lib/glysellin/discount_type_calculator/order_percentage.rb +16 -0
  150. data/lib/glysellin/engine.rb +14 -0
  151. data/lib/glysellin/engine/routes.rb +61 -0
  152. data/lib/glysellin/gateway.rb +16 -0
  153. data/lib/glysellin/gateway/atos.rb +111 -0
  154. data/lib/glysellin/gateway/base.rb +43 -0
  155. data/lib/glysellin/gateway/check.rb +34 -0
  156. data/lib/glysellin/gateway/paypal_integral.rb +71 -0
  157. data/lib/glysellin/helpers.rb +15 -0
  158. data/lib/glysellin/helpers/controller.rb +22 -0
  159. data/lib/glysellin/helpers/countries.rb +261 -0
  160. data/lib/glysellin/helpers/views.rb +28 -0
  161. data/lib/glysellin/product_methods.rb +66 -0
  162. data/lib/glysellin/products_list.rb +72 -0
  163. data/lib/glysellin/property_finder.rb +13 -0
  164. data/lib/glysellin/shipping_carrier.rb +14 -0
  165. data/lib/glysellin/shipping_carrier/base.rb +55 -0
  166. data/lib/glysellin/shipping_carrier/colissimo.rb +19 -0
  167. data/lib/glysellin/shipping_carrier/flat_rate.rb +19 -0
  168. data/lib/glysellin/shipping_carrier/free_shipping.rb +14 -0
  169. data/lib/glysellin/shipping_carrier/helpers/country_weight_table.rb +65 -0
  170. data/lib/glysellin/shipping_carrier/lettre_max.rb +19 -0
  171. data/lib/glysellin/version.rb +3 -0
  172. data/lib/tasks/glysellin_tasks.rake +37 -0
  173. metadata +341 -0
@@ -0,0 +1,13 @@
1
+ <%= render partial: "navigation", locals: { cart: current_cart } %>
2
+
3
+ <% ready = current_cart.state_name == :ready %>
4
+
5
+ <% if current_cart.state_index > 0 && !ready %>
6
+ <%= render partial: "recap", locals: { cart: current_cart } %>
7
+ <% end %>
8
+
9
+ <%= render partial: "glysellin/cart/states/#{ current_cart.state }", locals: { cart: current_cart } %>
10
+
11
+ <% unless ready %>
12
+ <%= link_to t("glysellin.labels.cart.cancel"), cart_path, method: "delete" %>
13
+ <% end %>
@@ -0,0 +1,25 @@
1
+ <%= simple_form_for cart, url: cart_addresses_path, method: "put" do |f| %>
2
+ <h2><%= t('glysellin.labels.forms.customer_details') %></h2>
3
+
4
+ <%= f.simple_fields_for :customer do |fc| %>
5
+ <%# new_record = fc.object.new_record? %>
6
+ <% new_record = !fc.object.id %>
7
+
8
+ <%= fc.input :email, :input_html => { :disabled => !new_record } %>
9
+
10
+ <% if new_record %>
11
+ <%= fc.input :password %>
12
+ <%= fc.input :password_confirmation %>
13
+
14
+ <%= link_to new_user_session_path do %>
15
+ <%= t('glysellin.labels.customer.sign_in') %>
16
+ <% end %>
17
+ <% end %>
18
+ <% end %>
19
+
20
+ <h2><%= t('glysellin.labels.forms.fill_in_your_address') %></h2>
21
+
22
+ <%= addresses_fields_for f, f.object.customer %>
23
+
24
+ <%= f.button :submit, t('glysellin.labels.forms.confirm_addresses') %>
25
+ <% end %>
@@ -0,0 +1,14 @@
1
+ <h2><%= t('glysellin.labels.forms.choose_payment_method') %></h2>
2
+
3
+ <%= simple_form_for cart, url: cart_payment_method_path, method: "put" do |f| %>
4
+ <%= f.input :payment_method_id do %>
5
+ <% Glysellin::PaymentMethod.ordered.each do |payment_method| %>
6
+ <label class="radio">
7
+ <%= f.radio_button :payment_method_id, payment_method.id %>
8
+ <%= payment_method.name %>
9
+ </label>
10
+ <% end %>
11
+ <% end %>
12
+
13
+ <%= f.button :submit, t('glysellin.labels.forms.confirm_payment_method') %>
14
+ <% end %>
@@ -0,0 +1,14 @@
1
+ <h2><%= t('glysellin.labels.forms.choose_shipping_method') %></h2>
2
+
3
+ <%= simple_form_for cart, url: cart_shipping_method_path, method: "put" do |f| %>
4
+ <%= f.input :shipping_method_id do %>
5
+ <% Glysellin::ShippingMethod.ordered.each do |shipping_method| %>
6
+ <label class="radio">
7
+ <%= f.radio_button :shipping_method_id, shipping_method.id %>
8
+ <%= shipping_method.name %>
9
+ </label>
10
+ <% end %>
11
+ <% end %>
12
+
13
+ <%= f.button :button, t('glysellin.labels.forms.confirm_shipping_method'), type: "submit" %>
14
+ <% end %>
@@ -0,0 +1,3 @@
1
+ <h2><%= t('glysellin.labels.cart.your_cart') %></h2>
2
+
3
+ <%= render partial: 'products', locals: { :cart => current_cart, :editable => true } %>
@@ -0,0 +1,5 @@
1
+ <h2><%= t('glysellin.labels.cart.your_cart') %></h2>
2
+
3
+ <%= t('glysellin.labels.cart.no_products_in_cart') %>
4
+
5
+ <%= link_to t('glysellin.labels.cart.back_to_shop'), shop_path %>
@@ -0,0 +1 @@
1
+ <%= render partial: 'glysellin/orders/order', locals: { order: current_cart.order } %>
@@ -0,0 +1,5 @@
1
+ --------------------------------------------------------
2
+ Récapitulatif de la commande Numéro : <%= order.ref %>:
3
+ --------------------------------------------------------
4
+
5
+ Email du client: <%= order.customer.email %>
@@ -0,0 +1,8 @@
1
+ Une commande avec paiement par chèque a été passée sur le site.
2
+
3
+ <%= render partial: 'order_header', locals: { order: @order } %>
4
+
5
+
6
+ <%= render partial: 'glysellin/shared/order', locals: { order: @order } %>
7
+
8
+ <%= render partial: 'glysellin/shared/mailer/footer' %>
@@ -0,0 +1,8 @@
1
+ Une commande a été validée sur le site.
2
+
3
+ <%= render partial: 'order_header', locals: { order: @order } %>
4
+
5
+
6
+ <%= render partial: 'glysellin/shared/order', locals: { order: @order } %>
7
+
8
+ <%= render partial: 'glysellin/shared/mailer/footer' %>
@@ -0,0 +1,3 @@
1
+ Toute l'équipe de <%= Glysellin.shop_name %> vous remercie pour votre commande !
2
+
3
+ <%= render partial: 'glysellin/shared/mailer/footer' %>
@@ -0,0 +1,5 @@
1
+ Récapitulatif de votre commande :
2
+
3
+ --------------------------------------------------------
4
+ Votre numéro de commande : <%= order.ref %>:
5
+ --------------------------------------------------------
@@ -0,0 +1,7 @@
1
+ Votre commande a bien été prise en compte et est en attente de paiement
2
+
3
+ <%= render partial: 'order_header', locals: { order: @order } %>
4
+
5
+ <%= render partial: 'glysellin/shared/order', locals: { order: @order } %>
6
+
7
+ <%= render partial: 'order_footer' %>
@@ -0,0 +1,7 @@
1
+ Le paiement de votre commande a bien été validé.
2
+
3
+ <%= render partial: 'order_header', locals: { order: @order } %>
4
+
5
+ <%= render partial: 'glysellin/shared/order', locals: { order: @order } %>
6
+
7
+ <%= render partial: 'order_footer' %>
@@ -0,0 +1,8 @@
1
+ Votre commande a été expédiée
2
+
3
+ <%= render partial: 'order_header', locals: { order: @order } %>
4
+
5
+
6
+ <%= render partial: 'glysellin/shared/order', locals: { order: @order } %>
7
+
8
+ <%= render partial: 'glysellin/shared/mailer/footer' %>
@@ -0,0 +1,29 @@
1
+ <div class="addresses-fields-container" >
2
+ <div class="billing-address-container">
3
+ <%= form.simple_fields_for :billing_address do |fsa| %>
4
+ <%= fsa.input :last_name %>
5
+ <%= fsa.input :first_name %>
6
+ <%= fsa.input :address, :as => :string %>
7
+ <%= fsa.input :zip %>
8
+ <%= fsa.input :city %>
9
+ <%= fsa.input :country, collection: countries_option_list %>
10
+ <%= fsa.input :tel %>
11
+ <% end %>
12
+ </div>
13
+
14
+ <%= form.input :use_another_address_for_shipping, as: 'boolean',
15
+ wrapper_html: { id: "billing-address-controls" },
16
+ input_html: { data: { 'toggle' => 'address' }, checked: (form.object.has_shipping_address? ? 'checked' : '') } %>
17
+
18
+ <div class="shipping-address-container">
19
+ <%= form.simple_fields_for :shipping_address do |fsa| %>
20
+ <%= fsa.input :last_name %>
21
+ <%= fsa.input :first_name %>
22
+ <%= fsa.input :address, :as => :string %>
23
+ <%= fsa.input :zip %>
24
+ <%= fsa.input :city %>
25
+ <%= fsa.input :country, collection: countries_option_list %>
26
+ <%= fsa.input :tel %>
27
+ <% end %>
28
+ </div>
29
+ </div>
@@ -0,0 +1,18 @@
1
+ <h2><%= t('glysellin.labels.order.order_summary_title') %></h2>
2
+ <%= "#{t('glysellin.labels.order.order_reference')} : #{ order.ref }" %>
3
+
4
+ <h3><%= t('glysellin.labels.order.your_informations') %></h3>
5
+
6
+ <%= render partial: 'glysellin/cart/recap/addresses', locals: { cart: order } %>
7
+
8
+ <h3><%= t('glysellin.labels.order.your_cart') %></h3>
9
+ <%= render partial: 'glysellin/cart/products', locals: { cart: order } %>
10
+
11
+ <h3><%= t('glysellin.labels.order.payment') %></h3>
12
+ <% if order.paid? %>
13
+ <%= t("glysellin.labels.order.paid_on_by", date: l(order.paid_on, format: :short), method: order.payment_method.name) %>
14
+ <% else %>
15
+ <%= (render order.payment_method.request_button(order)).html_safe %>
16
+ <% end %>
17
+
18
+ <br>
@@ -0,0 +1,13 @@
1
+ <h2><%= t('glysellin.labels.payment_responses.payment_canceled') %></h2>
2
+
3
+ <%= t('glysellin.labels.payment_responses.canceled_payment_text') %>
4
+ <br />
5
+ <br />
6
+ <% if order %>
7
+ <%= t('glysellin.labels.payment_responses.try_to_pay_again')%>
8
+ <br />
9
+ <%= render :partial => "glysellin/payment_methods/#{order.payment_method.slug}", :locals => { :order => order } %>
10
+ <% end %>
11
+ <br />
12
+ <br />
13
+ <%= link_to t('glysellin.labels.misc.back_to_homepage'), root_path, :class => 'btn' %>
@@ -0,0 +1,6 @@
1
+ <h2><%= t('glysellin.labels.payment_responses.successfully_paid') %></h2>
2
+
3
+ <%= t('glysellin.labels.payment_responses.successfull_payment_text') %>
4
+ <br />
5
+ <br />
6
+ <%= link_to t('glysellin.labels.misc.back_to_homepage'), root_path, :class => 'btn' %>
@@ -0,0 +1,5 @@
1
+ <% if @response_type == 'paid' %>
2
+ <%= render :partial => 'payment_successful', locals: { order: @order } %>
3
+ <% else %>
4
+ <%= render :partial => 'payment_canceled', locals: { order: @order } %>
5
+ <% end %>
@@ -0,0 +1,22 @@
1
+ <% payment_service_for order.id, Glysellin::Gateway::PaypalIntegral.account, :amount => order.total_price, :currency => 'EUR', :service => :paypal do |service|
2
+ address = order.billing_address
3
+
4
+ service.customer :first_name => address.first_name,
5
+ :last_name => address.last_name,
6
+ :phone => address.tel
7
+ service.billing_address :city => address.city,
8
+ :address1 => address.address,
9
+ :country => address.country,
10
+ :zip => address.zip
11
+ service.item_name "#{ t('glysellin.labels.order.order_title') } ##{ order.ref }"
12
+ service.invoice order.ref
13
+ service.tax '0.00'
14
+
15
+ service.notify_url gateway_response_order_path(order, :only_path => false)
16
+ service.return_url typed_payment_response_orders_path(:type => 'paid', :only_path => false)
17
+ service.cancel_return_url typed_payment_response_orders_path(:type => 'cancel', :only_path => false)
18
+ %>
19
+
20
+ <% link_options ||= {} %>
21
+ <%= submit_tag t('glysellin.labels.payment_methods.pay_with_paypal'), link_options %>
22
+ <% end %>
@@ -0,0 +1,16 @@
1
+ <%= form_tag cart_products_path, class: 'add-to-cart-form', remote: options[:remote], data: { "add-to-cart-form" => true } do %>
2
+ <div class="product-quantity">
3
+ <%= number_field :cart, :quantity, value: 1 %>
4
+ </div>
5
+ <div class="submit-container">
6
+ <% if product.variants.length > 1 %>
7
+ <%= select_tag 'cart[product_id]', options_for_select(product.variants.collect {|v| [ v.name, v.id ] }) %>
8
+ <% else %>
9
+ <%= hidden_field_tag 'cart[product_id]', product.variants.first.id %>
10
+ <% end %>
11
+
12
+ <button class="submit" type="submit">
13
+ <%= t('glysellin.labels.cart.add_to_cart') %>
14
+ </button>
15
+ </div>
16
+ <% end %>
@@ -0,0 +1,21 @@
1
+ <div class="product-container">
2
+ <span class="name">
3
+ <%= link_to product.name, product_path(product) %>
4
+ </span>
5
+ <% if product.image %>
6
+ <div class="image">
7
+ <%= image_tag product.image.url(:thumb) %>
8
+ </div>
9
+ <% end %>
10
+ <div class="description">
11
+ <%= product.description %>
12
+ </div>
13
+
14
+ <div class="buying-infos">
15
+ <span class="price">
16
+ <%= number_to_currency(product.price) %>
17
+ </span>
18
+
19
+ <%= add_to_cart_form(product) %>
20
+ </div>
21
+ </div>
File without changes
@@ -0,0 +1,3 @@
1
+ <% @products.each do |product| %>
2
+ <%= render partial: "item", locals: { product: product } %>
3
+ <% end %>
@@ -0,0 +1,3 @@
1
+ <%= render partial: "item", locals: { product: @product } %>
2
+
3
+ <%= link_to t('glysellin.labels.misc.back_to_shop'), root_path %>
@@ -0,0 +1,11 @@
1
+ <%= address.last_name %> <%= address.first_name %>
2
+ <br>
3
+ <%- if address.tel.presence -%>
4
+ <%= address.tel %>
5
+ <br>
6
+ <%- end -%>
7
+ <%= address.address %>
8
+ <br>
9
+ <%= address.zip %> <%= address.city %>
10
+ <br>
11
+ <%= Glysellin::Helpers::Countries::COUNTRIES_LIST[address.country] %>
@@ -0,0 +1,7 @@
1
+ Nom complet : <%= address.last_name %> <%= address.first_name %>
2
+ <%- if address.tel.presence -%>
3
+ Tél: <%= address.tel %>
4
+ <%- end -%>
5
+ <%= address.address %>
6
+ <%= address.zip %> <%= address.city %>
7
+ <%= address.country %>
@@ -0,0 +1,56 @@
1
+ Adresse de facturation :
2
+ ------------------------------
3
+
4
+ <%- billing_address = order.billing_address -%>
5
+ Nom complet : <%= billing_address.last_name %> <%= billing_address.first_name %>
6
+ <%- if billing_address.tel.presence -%>
7
+ Tél: <%= billing_address.tel %>
8
+ <%- end -%>
9
+ <%= billing_address.address %>
10
+ <%= billing_address.zip %> <%= billing_address.city %>
11
+ <%= billing_address.country %>
12
+
13
+
14
+
15
+ Adresse de livraison :
16
+ ------------------------------
17
+
18
+ <%- shipping_address = order.shipping_address -%>
19
+ Nom complet : <%= shipping_address.last_name %> <%= shipping_address.first_name %>
20
+ <%- if shipping_address.tel.presence -%>
21
+ Tél: <%= shipping_address.tel %>
22
+ <%- end -%>
23
+ <%= shipping_address.address %>
24
+ <%= shipping_address.zip %> <%= shipping_address.city %>
25
+ <%= shipping_address.country %>
26
+
27
+
28
+
29
+ Produits :
30
+ ------------------------------
31
+
32
+ <%- order.products.each do |item| -%>
33
+ Nom : <%= item.name %>
34
+ Quantité : <%= item.quantity %>
35
+ Prix TTC : <%= number_to_currency(item.price) %>
36
+ -----------------------
37
+ <%- end -%>
38
+
39
+ <%- if order.subtotal != order.total_price || Glysellin.show_subtotal_if_identical -%>
40
+ Sous Total TTC : <%= number_to_currency(order.subtotal) %>
41
+ <% end %>
42
+ <%- if order.adjustments.length > 0 -%>
43
+ <% order.adjustments.each do |adjustment| -%>
44
+ <%= adjustment.name %> : <%= number_to_currency(adjustment.value) %>
45
+ <%- end -%>
46
+ <%- end -%>
47
+ Total TTC : <%= number_to_currency(order.total_price) %>
48
+
49
+
50
+ Paiement :
51
+ ------------------------------
52
+
53
+ Mode de paiement : <%= order.payment_method.name %>
54
+ Statut : <%= t("glysellin.labels.payments.statuses.#{ order.payment.status }") %>
55
+ Date : <%= order.payment.last_payment_action_on %>
56
+
@@ -0,0 +1,2 @@
1
+ --------------------------------------------------------------------------------
2
+ Ceci est un message généré automatiquement, merci de ne pas essayer d'y répondre
@@ -0,0 +1,14 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>Glysellin</title>
5
+ <%= stylesheet_link_tag "glysellin/application", "application", :media => "all" %>
6
+ <%= csrf_meta_tags %>
7
+ </head>
8
+ <body>
9
+
10
+ <%= yield %>
11
+
12
+ <%= javascript_include_tag "glysellin/application" %>
13
+ </body>
14
+ </html>
@@ -0,0 +1,113 @@
1
+ en:
2
+ glysellin:
3
+ controllers:
4
+ errors:
5
+ order_doesnt_exist: "The requested order reference doesn't exist"
6
+ errors:
7
+ cart:
8
+ item_not_for_sale: "Sorry, %{item} is no longer for sale"
9
+ item_out_of_stock: "Sorry, %{item} is out of stock"
10
+ not_enough_stock_for_item: "Sorry, only #{stock} #{item} are still available"
11
+ invalid_discount_code: "The discount code you used is not valid"
12
+ shipping_method_unavailable_for_country: "Sorry but we can't ship to %{country} with %{method}, please choose another shipping method"
13
+ state_transitions:
14
+ addresses: "Errors were found in the form you submitted, please review its fields before it can be saved"
15
+ choose_shipping_method: "Please choose a shipping method"
16
+ choose_payment_method: "Please choose a payment method"
17
+ labels:
18
+ misc:
19
+ back_to_homepage: "Back to home page"
20
+ forms:
21
+ customer_details: "Your account"
22
+ fill_in_your_address: "Fill in your address"
23
+ confirm_addresses: "Confirm your address"
24
+ choose_payment_method: "Choose your payment method"
25
+ confirm_payment_method: "Confirm payment method"
26
+ choose_shipping_method: "Choose your shipping method"
27
+ confirm_shipping_method: "Confirm shipping method"
28
+ customer:
29
+ sign_in: "Sign in"
30
+ sign_up: "Sign up"
31
+ order:
32
+ billing_address: "Billing address"
33
+ shipping_address: "Shipping address"
34
+ order_summary_title: "Order summary"
35
+ your_informations: "Your informations"
36
+ your_cart: "Your cart"
37
+ order_reference: "Order reference"
38
+ sku: "SKU"
39
+ name: "Product name"
40
+ eot_price: "Excluding VAT price"
41
+ price: "Price"
42
+ subtotal: "Sub-total"
43
+ shipping: "Shipping"
44
+ total: "Total"
45
+ pay: "Pay"
46
+ payment: "Payment"
47
+ no_payment_method_choosen: "No payment method choosen"
48
+ order_title: Order
49
+ quantity: "Quantity"
50
+ unit_price: "Unit price"
51
+ discount_code: "Discount code"
52
+ paid_on_by: "Paid on %{date} - with %{method}"
53
+ payment_methods:
54
+ pay_with_paypal: Payer avec paypal
55
+ check:
56
+ send_your_check_text: "To pay the order, please send your check at <strong>%{check_destination}</strong>.<br>The check label must be <strong>%{check_order}</strong>.<br>Don't forget to specify the following order reference with your check : <strong>%{order_ref}</strong>."
57
+ payment_responses:
58
+ successfully_paid: "Payment successful"
59
+ successfull_payment_text: "Your payment has been successfully processed, we'll take your order into account as fast as we can. An e-mail has been sent to you with all the relevant informations about your order."
60
+ payments:
61
+ statuses:
62
+ pending: "Pending"
63
+ paid: "Paid"
64
+ canceled: "Canceled"
65
+ orders:
66
+ statuses:
67
+ payment: Payment pending
68
+ paid: Paid
69
+ shipping: Shipping
70
+ shipped: Shipped
71
+ cart:
72
+ add_to_cart: "Add to cart"
73
+ no_products_in_cart: "No products in your cart"
74
+ products_count: "%{count} products in your cart"
75
+ your_cart: "Your cart"
76
+ create_order: "Order"
77
+ create_order_form: "Order"
78
+ back_to_shop: "Back to shop"
79
+ remove_from_cart: "Delete"
80
+ update: "Update cart"
81
+ update_discount: "Update discount code"
82
+ create_order_form: "Submit order"
83
+ follow: "Go to order"
84
+ cancel: "Cancel order"
85
+ products: "Your products"
86
+ informations: "Your informations"
87
+ shipping_method: "Shipping method"
88
+ payment_method: "Payment method"
89
+ orders:
90
+ states:
91
+ created: "Created"
92
+ filling_address: "Addresses not filled"
93
+ address: "Addresses filled"
94
+ payment: "Payment method chosen"
95
+ paid: "Paid"
96
+ shipped: "Shipped"
97
+ cart:
98
+ states:
99
+ filled: "Cart"
100
+ addresses: "Your informations"
101
+ choose_shipping_method: "Shipping method"
102
+ choose_payment_method: "Payment method"
103
+ ready: "Payment"
104
+ order_admin_mailer:
105
+ send_order_paid_email:
106
+ subject: "A new order has validated"
107
+ send_check_order_created_email:
108
+ subject: "An order with Check payment method has been placed"
109
+ order_customer_mailer:
110
+ send_order_created_email:
111
+ subject: "Your order has been placed"
112
+ send_order_paid_email:
113
+ subject: "Your payment has been accepted"