From 8f6ec9bd9b3e1fb82bbd85caf9bd2887e5d3d570 Mon Sep 17 00:00:00 2001 From: Rob H Date: Wed, 10 Jul 2013 08:20:21 +0530 Subject: [PATCH] WIP (Spree Update): Fix frontend order payment summary --- .../replace_payment_name_with_description.rb | 5 ++ .../shared/_order_details_steps_data.html.erb | 61 ++++++++----------- 2 files changed, 30 insertions(+), 36 deletions(-) create mode 100644 app/overrides/replace_payment_name_with_description.rb diff --git a/app/overrides/replace_payment_name_with_description.rb b/app/overrides/replace_payment_name_with_description.rb new file mode 100644 index 0000000000..60566fe780 --- /dev/null +++ b/app/overrides/replace_payment_name_with_description.rb @@ -0,0 +1,5 @@ +Deface::Override.new(:virtual_path => "spree/payments/_payment", + :replace => "code[erb-loud]:contains('content_tag(:span, payment.payment_method.name)')", + :text => "<%= content_tag( :span, ( payment.payment_method.description || payment.payment_method.name ).html_safe ) %>", + :name => "replace_payment_name_with_description", + :original => 'dff62efcadc0f9e6513b0f81a51ebbda035f78f6') \ No newline at end of file diff --git a/app/views/spree/shared/_order_details_steps_data.html.erb b/app/views/spree/shared/_order_details_steps_data.html.erb index 396e2be2fd..005209cd1e 100644 --- a/app/views/spree/shared/_order_details_steps_data.html.erb +++ b/app/views/spree/shared/_order_details_steps_data.html.erb @@ -1,49 +1,38 @@
- -
-
<%= "Customer Details" %> <%= link_to "(#{t(:edit)})", checkout_state_path(:address) unless @order.completed? %>
-
- Name: <%= order.bill_address.full_name %>
- Address: <%= order.bill_address.address1 + ", " + order.bill_address.city %> -
-
-
-
<%= "Distributor Details" %> <%# link_to "(#{t(:edit)})", checkout_state_path(:address) unless @order.completed? %>
-
- Distributor: <%= order.distributor.name %>
- Address: <%= order.distributor.address.address1 + ", " + order.distributor.address.city %> + <% if order.has_step?("address") %> +
+
<%= "Customer Details" %> <%= link_to "(#{t(:edit)})", checkout_state_path(:address) unless @order.completed? %>
+
+ Name: <%= order.bill_address.full_name %>
+ Address: <%= order.bill_address.address1 + ", " + order.bill_address.city %> +
-
- + <% end %> +
+
-
id="eft-payment-alert"<% end %>> + +
<%= t(:payment_information) %> <%= link_to "(#{t(:edit)})", checkout_state_path(:payment) unless @order.completed? %>
- <% if order.payment_method.name.include? "PayPal" %> + <% if order.payments.any? { |payment| payment.payment_method.name.include? "PayPal" } %>
Your payment via PayPal has been processed successfully.
- <% elsif order.payment_method.name.include? "EFT" %> - <%= order.payment_method.description.html_safe %> - <% elsif order.credit_cards.empty? == false %> - - <%= image_tag "credit_cards/icons/#{order.credit_cards.first.cc_type}.png" %> - <%= t(:ending_in)%> <%= order.credit_cards.first.last_digits %> - -
- - <%= order.credit_cards.first.first_name %> - <%= order.credit_cards.first.last_name %> - - <% elsif order.payment_method.type == "Spree::PaymentMethod::Check" %> - <%= order.payment_method.description %> - <% end %> + <% end %> + <%= render order.payments.valid %>
+
\ No newline at end of file