forgeos_commerce_front 1.9.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (110) hide show
  1. data/COPYING +339 -0
  2. data/COPYING.LESSER +165 -0
  3. data/Gemfile +2 -0
  4. data/LICENSE +2 -0
  5. data/README.textile +28 -0
  6. data/app/assets/images/commerce_front/cart/calulate.png +0 -0
  7. data/app/assets/images/commerce_front/cart/cart.png +0 -0
  8. data/app/assets/images/commerce_front/cart/change_quantity.png +0 -0
  9. data/app/assets/images/commerce_front/cart/delete.png +0 -0
  10. data/app/assets/images/commerce_front/cart/reduction.png +0 -0
  11. data/app/assets/images/commerce_front/cart/steps_left.png +0 -0
  12. data/app/assets/images/commerce_front/cart/steps_right.png +0 -0
  13. data/app/assets/images/commerce_front/product.jpg +0 -0
  14. data/app/assets/javascripts/commerce_front/functions.js +10 -0
  15. data/app/assets/javascripts/commerce_front/init.js +4 -0
  16. data/app/assets/javascripts/commerce_front/jquery.jnotify.min.js +21 -0
  17. data/app/assets/stylesheets/commerce_front/_cart.css.sass +97 -0
  18. data/app/assets/stylesheets/commerce_front/_common.css.sass +13 -0
  19. data/app/assets/stylesheets/commerce_front/_forms.css.sass +15 -0
  20. data/app/assets/stylesheets/commerce_front/_jnotify.css.sass +65 -0
  21. data/app/assets/stylesheets/commerce_front/style.css.sass +4 -0
  22. data/app/controllers/addresses_controller.rb +71 -0
  23. data/app/controllers/application_controller.rb +21 -0
  24. data/app/controllers/cart_controller.rb +144 -0
  25. data/app/controllers/newsletters_controller.rb +20 -0
  26. data/app/controllers/order_controller.rb +413 -0
  27. data/app/controllers/orders_controller.rb +32 -0
  28. data/app/controllers/person_sessions_controller.rb +23 -0
  29. data/app/controllers/users_controller.rb +164 -0
  30. data/app/helpers/application_helper.rb +73 -0
  31. data/app/helpers/cart_helper.rb +25 -0
  32. data/app/helpers/order_helper.rb +59 -0
  33. data/app/models/address.rb +18 -0
  34. data/app/models/notifier.rb +88 -0
  35. data/app/models/order.rb +13 -0
  36. data/app/models/user.rb +16 -0
  37. data/app/models/user_address.rb +15 -0
  38. data/app/views/addresses/_address_form.html.haml +18 -0
  39. data/app/views/addresses/_multiple_address_form.html.haml +27 -0
  40. data/app/views/cart/_free_products.html.haml +3 -0
  41. data/app/views/cart/_tbody.html.haml +25 -0
  42. data/app/views/cart/_total.html.haml +46 -0
  43. data/app/views/cart/index.html.haml +32 -0
  44. data/app/views/notifier/newsletter.html.haml +2 -0
  45. data/app/views/notifier/reset_password.html.haml +9 -0
  46. data/app/views/notifier/validation_user_account.html.haml +9 -0
  47. data/app/views/notifier/waiting_for_cheque_notification.html.haml +2 -0
  48. data/app/views/order/_form_address.html.haml +44 -0
  49. data/app/views/order/_tbody.html.haml +21 -0
  50. data/app/views/order/_total.html.haml +50 -0
  51. data/app/views/order/cheque_payment.html.haml +1 -0
  52. data/app/views/order/create.html.haml +76 -0
  53. data/app/views/order/deliveries.html.haml +28 -0
  54. data/app/views/order/new.html.haml +26 -0
  55. data/app/views/order/so_colissimo.html.haml +8 -0
  56. data/app/views/orders/index.html.haml +34 -0
  57. data/app/views/person_sessions/_form.html.haml +23 -0
  58. data/app/views/person_sessions/new.html.haml +1 -0
  59. data/app/views/person_sessions/new_reset_password.html.haml +7 -0
  60. data/app/views/users/_edit_form.html.haml +61 -0
  61. data/app/views/users/_form_create.html.haml +27 -0
  62. data/app/views/users/_form_quick_create.html.haml +16 -0
  63. data/app/views/users/_login_or_new.html.haml +10 -0
  64. data/app/views/users/forgotten_password.html.haml +12 -0
  65. data/app/views/users/new.html.haml +1 -0
  66. data/app/views/users/new_password.html.haml +10 -0
  67. data/app/views/users/show.html.haml +1 -0
  68. data/config/commerce.example.yml +27 -0
  69. data/config/initializers/commerce_front.rb +6 -0
  70. data/config/locales/fr.yml +85 -0
  71. data/config/routes.rb +17 -0
  72. data/db/migrate/20110311134232_add_form_attributes_to_addresses.rb +9 -0
  73. data/lib/field_error_proc_changer.rb +19 -0
  74. data/lib/forgeos/commerce_front.rb +6 -0
  75. data/lib/forgeos/commerce_front/engine.rb +10 -0
  76. data/lib/forgeos/commerce_front/version.rb +5 -0
  77. data/lib/forgeos_commerce_front.rb +1 -0
  78. data/lib/tasks/install.rake +13 -0
  79. data/recipes/deploy.rb +6 -0
  80. data/test/dummy/Rakefile +7 -0
  81. data/test/dummy/app/assets/javascripts/application.js +9 -0
  82. data/test/dummy/app/assets/stylesheets/application.css +7 -0
  83. data/test/dummy/app/controllers/application_controller.rb +3 -0
  84. data/test/dummy/app/helpers/application_helper.rb +2 -0
  85. data/test/dummy/app/views/layouts/application.html.erb +14 -0
  86. data/test/dummy/config.ru +4 -0
  87. data/test/dummy/config/application.rb +42 -0
  88. data/test/dummy/config/boot.rb +10 -0
  89. data/test/dummy/config/database.yml +25 -0
  90. data/test/dummy/config/environment.rb +5 -0
  91. data/test/dummy/config/environments/development.rb +27 -0
  92. data/test/dummy/config/environments/production.rb +51 -0
  93. data/test/dummy/config/environments/test.rb +39 -0
  94. data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
  95. data/test/dummy/config/initializers/inflections.rb +10 -0
  96. data/test/dummy/config/initializers/mime_types.rb +5 -0
  97. data/test/dummy/config/initializers/secret_token.rb +7 -0
  98. data/test/dummy/config/initializers/session_store.rb +8 -0
  99. data/test/dummy/config/initializers/wrap_parameters.rb +14 -0
  100. data/test/dummy/config/locales/en.yml +5 -0
  101. data/test/dummy/config/routes.rb +58 -0
  102. data/test/dummy/log/development.log +0 -0
  103. data/test/dummy/public/404.html +26 -0
  104. data/test/dummy/public/422.html +26 -0
  105. data/test/dummy/public/500.html +26 -0
  106. data/test/dummy/public/favicon.ico +0 -0
  107. data/test/dummy/script/rails +6 -0
  108. data/test/forgeos_commerce_front_test.rb +7 -0
  109. data/test/test_helper.rb +10 -0
  110. metadata +197 -0
@@ -0,0 +1,13 @@
1
+ load File.join(Gem.loaded_specs['forgeos_commerce'].full_gem_path, 'app', 'models', 'order.rb')
2
+ Order.class_eval do
3
+
4
+ private
5
+
6
+ def waiting_for_cheque_event_with_notification
7
+ waiting_for_cheque_event_without_notification
8
+ if self.user
9
+ Notifier.deliver_waiting_for_cheque_notification(self)
10
+ end
11
+ end
12
+ alias_method_chain :waiting_for_cheque_event, :notification
13
+ end
@@ -0,0 +1,16 @@
1
+ load File.join(Gem.loaded_specs['forgeos_commerce'].full_gem_path, 'app', 'models', 'user.rb')
2
+ User.class_eval do
3
+ validates_confirmation_of :email, :if => :confirm_email?
4
+
5
+ def confirm_email?
6
+ Forgeos::CONFIG[:account]['checkout_quick_create']
7
+ end
8
+
9
+ def skip_presence_of_lastname?
10
+ not Forgeos::CONFIG[:account]['checkout_quick_create']
11
+ end
12
+
13
+ def skip_presence_of_firstname?
14
+ not Forgeos::CONFIG[:account]['checkout_quick_create']
15
+ end
16
+ end
@@ -0,0 +1,15 @@
1
+ load File.join(Gem.loaded_specs['forgeos_commerce'].full_gem_path, 'app', 'models', 'user_address.rb')
2
+ UserAddress.class_eval do
3
+
4
+ if Forgeos::CONFIG[:addresses] and mandatory_fields = Forgeos::CONFIG[:addresses]['mandatory_fields']
5
+ validates *mandatory_fields, :presence => true
6
+ end
7
+
8
+ def to_s
9
+ "#{I18n.t civility, :scope => [:civility, :label]} #{firstname} #{name} <br /> #{address} <br /> #{address_2} <br /> #{zip_code} #{city} <br />#{country.name.upcase}"
10
+ end
11
+
12
+ def designation
13
+ self.class.to_s.underscore
14
+ end
15
+ end
@@ -0,0 +1,18 @@
1
+ .grid_5
2
+ = f.label :address, "#{t(:address, :count => 1).capitalize} <em>*</em>"
3
+ = f.text_field :address
4
+ = f.text_field :address_2
5
+ .clear
6
+ .grid_2
7
+ = f.label :zip_code, "#{t(:zip_code).capitalize} <em>*</em>"
8
+ = f.text_field :zip_code
9
+ .clear
10
+ .grid_5
11
+ = f.label :city, "#{t(:city).capitalize} <em>*</em>"
12
+ = f.text_field :city
13
+ .clear
14
+
15
+ .grid_5
16
+ = f.label :country_id, "#{t(:country).capitalize} <em>*</em>"
17
+ = f.select :country_id, options_for_countries(f.object.country_id)
18
+ .clear
@@ -0,0 +1,27 @@
1
+ - form_for(address) do |f|
2
+ = link_to_remote(t(:delete), :url => user_address_path(f.object), :method => :delete, :confirm => "Voulez-vous vraiment supprimer cette adresse ?") unless f.object.new_record?
3
+ .grid_8
4
+ = f.label :address, "#{t(:address, :count => 1)} <em>*</em>"
5
+ = f.text_field :address
6
+ = f.text_field :address_2
7
+ .clear
8
+ .grid_2
9
+ = f.label :zip_code, "#{:zip_code} <em>*</em>"
10
+ = f.text_field :zip_code, :class => 'textpg'
11
+ .grid_3
12
+ = f.label :city, "#{t(:city)} <em>*</em>"
13
+ = f.text_field :city
14
+ .grid_3
15
+ = f.label :country_id, "#{t(:country)} <em>*</em>"
16
+ = f.select :country_id, options_for_countries(f.object.country_id)
17
+ .clear
18
+ //.grid_4
19
+ // = f.label :phone, "#{t(:phone)} <em>*</em>"
20
+ // = f.text_field :phone
21
+ //.grid_4
22
+ // = f.label :other_phone, "#{:other_phone}"
23
+ // = f.text_field :other_phone
24
+ //.clear
25
+ .requiredinfo
26
+ * #{t(:mandatory_field, :count => 2)}
27
+ .clear
@@ -0,0 +1,3 @@
1
+ - if @free_product_ids && !@free_product_ids.empty?
2
+ - Product.find_all_by_id(@free_product_ids).each do |free_product|
3
+ = "Produit #{free_product.name} gratuit !"
@@ -0,0 +1,25 @@
1
+ - unless current_cart.cart_items.nil? || current_cart.cart_items.empty?
2
+ - current_cart.cart_items.each do |cart_product|
3
+ - product = cart_product.product
4
+ %tr{:id => product.sku}
5
+ %td.delete.center
6
+ = remove_cart_product_link(cart_product.id)
7
+ %td.article
8
+ .grid_4
9
+ = image_tag '/images/commerce_front/product.jpg'
10
+ %p.grid_3.product_info
11
+ = link_to product.name, [:seo, product]
12
+ %span Catégorie
13
+ %span
14
+ Réf.
15
+ = product.sku
16
+ %td.quantity.center
17
+ = link_to_function '-', remote_function(:url => {:controller => 'cart', :action => 'update_quantity', :id => cart_product.id, :quantity => cart_product.quantity-1}), :class=> 'less_product'
18
+ = text_field_tag 'quantity', cart_product.quantity, :onchange => remote_function( :url => {:controller => 'cart', :action => 'update_quantity', :id => cart_product.id }, :with => "'quantity='+$(this).val()"), :class => 'quantity'
19
+ = link_to_function '+', remote_function({:url => {:controller => 'cart', :action => 'update_quantity', :id => cart_product.id, :quantity => cart_product.quantity+1}}), :class=> 'more_product'
20
+ %td.price.center
21
+ = price_with_currency(product.old_price)
22
+ %td.reduction.center
23
+ = price_with_currency(product.discount*cart_product.quantity)
24
+ %td.total_price.center
25
+ = price_with_currency(cart_product.total)
@@ -0,0 +1,46 @@
1
+ .total_block
2
+ .block
3
+ .grid_4.alignright
4
+ Sous total panier
5
+ .grid_6.alpha.omega
6
+ %span.space
7
+ &nbsp;
8
+ = price_with_currency(current_cart.total({:cart_voucher_discount => false, :cart_special_offer_discount => false, :product_voucher_discount => false, :patronage => false, :cart_packaging => false }))
9
+ .clear
10
+ .clear
11
+ .block
12
+ .grid_4.alignright
13
+ Réduction panier
14
+ .grid_6.alpha.omega
15
+ %span.space
16
+ &nbsp;
17
+ = price_with_currency(current_cart.discount)
18
+ .clear
19
+ %br
20
+ - if current_cart.packaging_price != 0
21
+ .block
22
+ .grid_3.alignleft
23
+ Frais d'emballage
24
+ .grid_3.alpha.omega.alignright
25
+ %span.space
26
+ &nbsp;
27
+ = price_with_currency(current_cart.packaging_price)
28
+ .clear
29
+ #total_block.block
30
+ .grid_4.alignright
31
+ Prix total TTC
32
+ .grid_6.alpha.omega
33
+ %span.big_price
34
+ #{price_with_currency(current_cart.total)} TTC
35
+ .clear
36
+
37
+ .order_block
38
+ .grid_4.alignright
39
+ - link_to root_path do
40
+ Continuer vos achats
41
+ .grid_6.alpha.omega
42
+ - form_tag url_for(:controller => 'order', :action => 'deliveries'), :method => :post do
43
+ %span.space
44
+ &nbsp;
45
+ = submit_tag 'Commander'
46
+ .clear
@@ -0,0 +1,32 @@
1
+ = step_order(0)
2
+ .clear
3
+
4
+ - unless current_cart.cart_items.empty?
5
+ .grid_24.cart_content
6
+ %table#cart_table
7
+ %thead
8
+ %tr
9
+ %th{ :colspan => 2 } Produit
10
+ %th Quantité
11
+ %th Prix unitaire
12
+ %th Réduction
13
+ %th Prix total
14
+ %tbody#tbody
15
+ = render :partial => 'tbody'
16
+
17
+ .grid_24#total
18
+ .grid_9.prefix_1
19
+ = display_voucher
20
+ #voucher_message
21
+ - if current_cart.voucher
22
+ - voucher = VoucherRule.find_by_id(current_cart.voucher)
23
+ %span= "Code validé ! #{voucher.name}" unless voucher.nil?
24
+ #free_products
25
+ = render :partial => 'free_products'
26
+ .grid_10.prefix_3.omega#cart_total
27
+ = render :partial => 'total'
28
+
29
+ - else
30
+ Il n'y a pas de produit dans votre panier
31
+
32
+ .clear
@@ -0,0 +1,2 @@
1
+ %p
2
+ = @email
@@ -0,0 +1,9 @@
1
+ %p
2
+ Email :
3
+ %span#email= @user.email
4
+ %br
5
+ Password:
6
+ %span#password= @password
7
+ %p
8
+ - link_to(url = new_password_user_url(:user_token => @user.perishable_token), :id => 'reset_password') do
9
+ = url
@@ -0,0 +1,9 @@
1
+ %p
2
+ Email :
3
+ %span#email= @user.email
4
+ %br
5
+ Password:
6
+ %span#password= @password
7
+ %p
8
+ - link_to(url = activate_user_url(:activation_code => @user.perishable_token), :id => 'activation') do
9
+ = url
@@ -0,0 +1,2 @@
1
+ - setting = Setting.first
2
+ = setting.cheque_message(@order)
@@ -0,0 +1,44 @@
1
+ = address.hidden_field :designation, :value => (address.object.designation or 'default')
2
+ = address.hidden_field :civility, :value => 0
3
+ = address.hidden_field :id, :value => current_cart_address.id unless current_cart_address.nil?
4
+
5
+ .champ.grid_6
6
+ .grid_2
7
+ = address.label :name, "Nom #{content_tag(:em, '*')}"
8
+ = address.text_field :name
9
+ .champ.grid_6
10
+ .grid_2
11
+ = address.label :firstname, "Prénom #{content_tag(:em, '*')}"
12
+ = address.text_field :firstname
13
+ .champ.grid_6
14
+ .grid_2
15
+ = address.label :address, "Adresse #{content_tag(:em, '*')}"
16
+ = address.text_field :address
17
+ .champ.grid_6
18
+ .grid_2
19
+ = address.label :zip_code, "Code postal #{content_tag(:em, '*')}"
20
+ = address.text_field :zip_code
21
+ .champ.grid_6
22
+ .grid_2
23
+ = address.label :city, "Ville #{content_tag(:em, '*')}"
24
+ = address.text_field :city
25
+
26
+ .champ.grid_6
27
+ .grid_2
28
+ = address.label :country_id, "Pays #{content_tag(:em, '*')}"
29
+ - countries = Country.find_all_by_printable_name(['France','Belgium'], :select => 'id,printable_name', :order=>'printable_name')
30
+ - options = options_from_collection_for_select(countries, :id, :printable_name, (!address.object.nil? && !address.object.country.nil?) ? address.object.country.id : 258419522 )
31
+ = address.select :country_id, options
32
+
33
+ - if address.object.form
34
+ - address.object.form.form_attributes.each do |form_attribute|
35
+ - if form_attribute.is_a? TextAttribute
36
+ .champ.grid_6
37
+ .grid_2
38
+ %label
39
+ = form_attribute.name
40
+ - if form_attribute.validate
41
+ %em *
42
+ = text_field_tag "order[#{address.object.type.underscore}_attributes[form_attributes[#{form_attribute.access_method}]]]", address.object.form_attributes[form_attribute.access_method]
43
+
44
+ .clear
@@ -0,0 +1,21 @@
1
+ - unless @order.order_details.nil? || @order.order_details.empty?
2
+ - @order.order_details.each do |order_detail|
3
+ - product = order_detail.product
4
+ %tr{:id => product.sku}
5
+ %td.article
6
+ .grid_4
7
+ = image_tag '/images/commerce_front/product.jpg'
8
+ %p.grid_3.product_info
9
+ = link_to product.name, [:seo, product]
10
+ %span Catégorie
11
+ %span
12
+ Réf.
13
+ = product.sku
14
+ %td.quantity.center
15
+ = text_field_tag 'quantity', order_detail.quantity, :class => 'quantity'
16
+ %td.price.center
17
+ = price_with_currency(product.old_price)
18
+ %td.reduction.center
19
+ = price_with_currency(order_detail.discount(:voucher_discount => false)*order_detail.quantity)
20
+ %td.total_price.center
21
+ = price_with_currency(order_detail.total)
@@ -0,0 +1,50 @@
1
+ .total_block
2
+ .block
3
+ .grid_4.alignright
4
+ Sous total panier
5
+ .grid_6.alpha.omega
6
+ %span.space
7
+ &nbsp;
8
+ = price_with_currency(@order.total({:cart_voucher_discount => false, :cart_special_offer_discount => false, :product_voucher_discount => false, :patronage => false}))
9
+ .clear
10
+ .clear
11
+ .block
12
+ .grid_4.alignright
13
+ Réduction panier
14
+ .grid_6.alpha.omega
15
+ %span.space
16
+ &nbsp;
17
+ = price_with_currency(@order.discount)
18
+ .clear
19
+ %br
20
+ - if current_cart.packaging_price != 0
21
+ .block
22
+ .grid_3.alignleft
23
+ Frais d'emballage
24
+ .grid_3.alpha.omega.alignright
25
+ %span.space
26
+ &nbsp;
27
+ = price_with_currency(current_cart.packaging_price)
28
+ .clear
29
+ #total_block.block
30
+ .grid_4.alignright
31
+ Prix total TTC
32
+ .grid_6.alpha.omega
33
+ %span.big_price
34
+ #{price_with_currency(@order.total)} TTC
35
+ .clear
36
+
37
+ .order_block
38
+ .grid_4.alignright
39
+ - link_to root_path do
40
+ Continuer vos achats
41
+ .grid_6.alpha.omega
42
+ - #TODO Use trnaslations and config
43
+ - form_tag url_for(:controller => 'order', :action => 'create'), :method => :post do
44
+ %h4 Choisissez votre mode de paiement
45
+ = payment_methods_list
46
+ .conditionpay
47
+ = check_box_tag("validchk")
48
+ %label J'accepte les conditions générales de vente
49
+ = submit_tag 'Commander'
50
+ .clear
@@ -0,0 +1 @@
1
+ = display_cheque_message
@@ -0,0 +1,76 @@
1
+ - if setting = Setting.first and setting.google_account.present? and setting.google_affiliation_store_name.present?
2
+ - content_for :google do
3
+ - javascript_tag do
4
+ var _gaq = _gaq || [];
5
+ = "_gaq.push(['_setAccount', '#{setting.google_account}' ]);"
6
+ _gaq.push(['_trackPageview']);
7
+ _gaq.push(['_addTrans',
8
+ = "'#{@order.reference}', // order ID - required"
9
+ = "'#{setting.google_affiliation_store_name}', // affiliation or store name"
10
+ = "'#{@order.total}', // total - required"
11
+ = "'#{@order.taxes.to_f}', // tax"
12
+ = "'#{@order.order_shipping.price.to_f}', // shipping"
13
+ = "'#{@order.address_delivery.city}', // city"
14
+ = "'#{@order.address_delivery.zip_code}', // state or province"
15
+ = "'#{@order.address_delivery.country.iso}' // country"
16
+ ]);
17
+
18
+ - @order.order_details.each do |item|
19
+ - javascript_tag do
20
+ _gaq.push(['_addItem',
21
+ = "'#{@order.reference}', // order ID - required"
22
+ = "'#{item.sku}', // SKU/code - required"
23
+ = "'#{item.name}', // product name"
24
+ = "'#{item.product.product_type.name}', // category or variation"
25
+ = "'#{item.price}', // unit price - required"
26
+ = "'#{item.quantity}' // quantity - required"
27
+ ]);
28
+ _gaq.push(['_trackTrans']); //submits transaction to the Analytics servers
29
+
30
+ (function() {
31
+ var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
32
+ ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
33
+ var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
34
+ })();
35
+
36
+
37
+ .grid_16
38
+ - case @order.payment_type
39
+ - when t("cmc_cic", :scope => 'payment', :count => 1)
40
+ %form{ :action => @payment.delete(:url_payment), :method => "post", :id => "payment_form"}
41
+ - @payment.each do |key,value|
42
+ = hidden_field_tag key, value unless key == :key
43
+ .payment_message
44
+ %p Vous aller être redirigé vers l'interface de paiement de la banque dans quelques instants
45
+ %img{:src => '/images/front/ajax-loader-2.gif'}
46
+
47
+ - when t("cyberplus", :scope => 'payment', :count => 1)
48
+ - form_tag('https://systempay.cyberpluspaiement.com/vads-payment/', :autocomplete => 'off', :id => 'payment_form') do
49
+ - @payment.each do |key,value|
50
+ = hidden_field_tag key, value unless key == :key
51
+
52
+ .payment_message
53
+ %p Vous aller être redirigé vers l'interface de paiement de la banque dans quelques instants
54
+ %img{:src => '/images/front/ajax-loader-2.gif'}
55
+
56
+ - when t("elysnet", :scope => 'payment', :count => 1)
57
+ = @payment
58
+
59
+ .payment_message
60
+ %p Vous aller être redirigé vers l'interface de paiement de la banque dans quelques instants
61
+ %img{:src => '/images/front/ajax-loader-2.gif'}
62
+
63
+ - when t("paypal", :scope => 'payment', :count => 1)
64
+ %form{ :action => @url_paypal, :id => 'payment_form'}
65
+ = hidden_field_tag :cmd, "_s-xclick"
66
+ = hidden_field_tag :encrypted, @order.paypal_encrypted
67
+
68
+ .payment_message
69
+ %p Vous aller être redirigé vers Paypal dans quelques instants
70
+ %img{:src => '/images/front/ajax-loader-2.gif'}
71
+
72
+ .clear
73
+ .clear
74
+
75
+ = javascript_tag "jQuery('#payment_form').submit();"
76
+
@@ -0,0 +1,28 @@
1
+ = step_order(1)
2
+ .clear
3
+
4
+ .grid_24
5
+ %h2 1 - Mode de livraison
6
+
7
+ .clear
8
+ .grid_24
9
+ - form_for(@order, :url => {:controller => 'order', :action => 'new'}) do |order|
10
+ .grid_12
11
+ %h2 2 - Adresse de facturation
12
+ %span Cette commande sera facturée à cette adresse
13
+ - unless order.object.address_invoice
14
+ - unless current_user.address_invoice.nil?
15
+ - order.object.build_address_invoice(current_user.address_invoice.attributes)
16
+ - else
17
+ - order.object.build_address_invoice
18
+ - order.fields_for :address_invoice do |address|
19
+ = render :partial => 'form_address', :locals => {:address => address, :current_cart_address => current_cart.address_invoice}
20
+
21
+ .grid_12
22
+ %h2 3 - Adresse de livraison
23
+ %span Cette commande sera livrée à cette adresse
24
+ - order.object.build_address_delivery unless order.object.address_delivery
25
+ - order.fields_for :address_delivery do |address|
26
+ = render :partial => 'form_address', :locals => {:address => address, :current_cart_address => current_cart.address_delivery}
27
+ .clear
28
+ = order.submit 'Mode de paiement'