mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-27 01:43:22 +00:00
Summarise distribution charges: order confirm page and email
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
/ replace_contents 'tfoot#order-charges'
|
||||
|
||||
- checkout_adjustments_for_summary(@order).each do |adjustment|
|
||||
%tr.total
|
||||
%td{:colspan => "4"}
|
||||
%strong= adjustment.label
|
||||
%td.total
|
||||
%span= adjustment.display_amount.to_html
|
||||
@@ -11,7 +11,7 @@ Order for: <%= @order.bill_address.full_name %>
|
||||
<% end %>
|
||||
============================================================
|
||||
Subtotal: <%= @order.display_item_total %>
|
||||
<% @order.adjustments.eligible.each do |adjustment| %>
|
||||
<% checkout_adjustments_for_summary(@order).each do |adjustment| %>
|
||||
<%= raw(adjustment.label) %> <%= adjustment.display_amount %>
|
||||
<% end %>
|
||||
Order Total: <%= @order.display_total %>
|
||||
|
||||
@@ -7,6 +7,8 @@ module EnterprisesDistributorInfoRichTextFeature
|
||||
initializer 'enterprises_distributor_info_rich_text_feature.mailer', :after => :load_config_initializers do |app|
|
||||
if OpenFoodWeb::FeatureToggle.enabled? :enterprises_distributor_info_rich_text
|
||||
::Spree::OrderMailer.class_eval do
|
||||
helper CheckoutHelper
|
||||
|
||||
def confirm_email(order, resend = false)
|
||||
find_order(order)
|
||||
subject = (resend ? "[#{t(:resend).upcase}] " : '')
|
||||
|
||||
@@ -324,13 +324,19 @@ feature %q{
|
||||
click_checkout_continue_button
|
||||
|
||||
# -- Checkout: Order complete
|
||||
page.should have_content('Your order has been processed successfully')
|
||||
page.should have_content(@payment_method_all.description)
|
||||
page.should have_content 'Your order has been processed successfully'
|
||||
page.should have_content @payment_method_all.description
|
||||
|
||||
page.should have_selector 'tfoot#order-charges tr.total td', text: 'Distribution'
|
||||
page.should have_selector 'tfoot#order-charges tr.total td', text: '$3.00'
|
||||
|
||||
# page.should have_content('Your order will be available on:')
|
||||
# page.should have_content('On Tuesday, 4 PM')
|
||||
# page.should have_content('12 Bungee Rd, Carion')
|
||||
|
||||
# -- Checkout: Email
|
||||
email = ActionMailer::Base.deliveries.last
|
||||
email.body.should =~ /Distribution \$3.00/
|
||||
end
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user