ba_spree 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/LICENSE +673 -0
- data/README.md +150 -0
- data/app/assets/config/manifest.js +1 -0
- data/app/assets/javascripts/ba_spree/admin_overrides/query_builder_controller.js +505 -0
- data/app/assets/javascripts/ba_spree/storefront/ba_spree_local_time.js +9 -0
- data/app/assets/stylesheets/spree/admin/custom.scss +40 -0
- data/app/controllers/ba_spree/checkout_controller_decorator.rb +111 -0
- data/app/controllers/ba_spree/store_controller_decorator.rb +55 -0
- data/app/controllers/concerns/ba_spree/theme_concern_decorator.rb +16 -0
- data/app/controllers/spree/admin/assets_controller_decorator.rb +48 -0
- data/app/controllers/spree/admin/products_controller_decorator.rb +25 -0
- data/app/controllers/spree/admin/promotion_rules_controller_decorator.rb +30 -0
- data/app/controllers/spree/admin/users_controller_decorator.rb +34 -0
- data/app/controllers/spree/contacts_controller_decorator.rb +23 -0
- data/app/controllers/spree/digital_links_controller.rb +61 -0
- data/app/controllers/spree/orders_controller_decorator.rb +24 -0
- data/app/decorators/ba_spree/product_pricing_decorator.rb +65 -0
- data/app/decorators/spree/current_decorator.rb +17 -0
- data/app/decorators/spree/money_decorator.rb +51 -0
- data/app/decorators/spree/order_email_subscriber_decorator.rb +64 -0
- data/app/decorators/spree/page_sections/featured_posts_decorator.rb +17 -0
- data/app/helpers/currency_rounding_helper.rb +10 -0
- data/app/helpers/spree/admin/filter_params_preservation.rb +130 -0
- data/app/helpers/spree/admin/navigation_helper_decorator.rb +23 -0
- data/app/helpers/spree/admin/promotion_rules_helper_decorator.rb +33 -0
- data/app/helpers/spree/admin/table_helper_decorator.rb +40 -0
- data/app/helpers/spree/base_helper_decorator.rb +63 -0
- data/app/helpers/spree/checkout_analytics_helper_decorator.rb +32 -0
- data/app/javascript/ba_spree/controllers/disable_when_hidden_controller.js +70 -0
- data/app/javascript/ba_spree/index.js +11 -0
- data/app/javascript/spree/admin/controllers/calendar_range_controller.js +61 -0
- data/app/javascript/spree/admin/controllers/slug_form_controller.js +17 -0
- data/app/models/ba_spree/address_decorator.rb +43 -0
- data/app/models/ba_spree/adjustment_decorator.rb +13 -0
- data/app/models/ba_spree/order_decorator.rb +95 -0
- data/app/models/ba_spree/order_updater_decorator.rb +33 -0
- data/app/models/ba_spree/payment_method_decorator.rb +10 -0
- data/app/models/ba_spree/product_decorator.rb +44 -0
- data/app/models/ba_spree/store_decorator.rb +23 -0
- data/app/models/ba_spree/variant_decorator.rb +49 -0
- data/app/models/concerns/spree/adjustment_source_decorator.rb +66 -0
- data/app/models/concerns/spree/product_property_metafields.rb +52 -0
- data/app/models/spree/adjustable/adjuster/promotion_decorator.rb +16 -0
- data/app/models/spree/admin/table/filter_decorator.rb +52 -0
- data/app/models/spree/admin/table/filter_group_decorator.rb +64 -0
- data/app/models/spree/asset_decorator.rb +102 -0
- data/app/models/spree/contact_decorator.rb +22 -0
- data/app/models/spree/digital_link_decorator.rb +9 -0
- data/app/models/spree/export_decorator.rb +34 -0
- data/app/models/spree/line_item_destroy_callback_decorator.rb +30 -0
- data/app/models/spree/metafield_definition_decorator.rb +34 -0
- data/app/models/spree/option_type_decorator.rb +22 -0
- data/app/models/spree/option_value_decorator.rb +19 -0
- data/app/models/spree/option_value_variant_decorator.rb +30 -0
- data/app/models/spree/order/address_book_decorator.rb +14 -0
- data/app/models/spree/order_merger_decorator.rb +29 -0
- data/app/models/spree/price_rules/customer_group_rule_decorator.rb +18 -0
- data/app/models/spree/price_rules/user_rule_decorator.rb +25 -0
- data/app/models/spree/price_rules/volume_rule_decorator.rb +25 -0
- data/app/models/spree/price_rules/zone_rule_decorator.rb +25 -0
- data/app/models/spree/pricing/batch_resolver.rb +96 -0
- data/app/models/spree/promotion_handler/cart_decorator.rb +51 -0
- data/app/models/spree/stock/packer_decorator.rb +61 -0
- data/app/models/spree/stock/prioritizer_decorator.rb +27 -0
- data/app/models/spree/tax_rate_decorator.rb +93 -0
- data/app/models/spree/taxon_decorator.rb +42 -0
- data/app/models/spree/user_bill_address_sync_decorator.rb +33 -0
- data/app/overrides/add_ba_spree_storefront_javascript_importmap_tags.rb +8 -0
- data/app/overrides/add_cache_to_product_listing_page.rb +41 -0
- data/app/overrides/add_class_to_login_link.rb +6 -0
- data/app/overrides/add_confirm_state_to_checkout_content_block.rb.rb +30 -0
- data/app/overrides/add_promotions_nav.rb +8 -0
- data/app/overrides/add_turbo_frame_to_admin_order_line_item_edit_link.rb +23 -0
- data/app/overrides/add_turbo_frame_to_promotion_action_edit_link.rb +20 -0
- data/app/overrides/add_turbo_stream_format_to_cart_path_in_cart_pane.rb +8 -0
- data/app/overrides/ba_spree_local_time_add_custom_javascript_import_map_tags.rb +8 -0
- data/app/overrides/disable_hidden_bill_address_fields_on_payment.rb +15 -0
- data/app/overrides/disable_turbo_on_user_registration_form.rb +18 -0
- data/app/overrides/fix_coupon_apply_button_layout.rb +7 -0
- data/app/overrides/hide_gift_cards_and_store_credits_from_account_nav.rb +11 -0
- data/app/overrides/hide_shipping_message_for_digital_only_orders.rb +15 -0
- data/app/overrides/localize_apply_button_text.rb +6 -0
- data/app/overrides/localize_newsletter_button_text.rb +6 -0
- data/app/overrides/replace_announcement_bar_text.rb +6 -0
- data/app/overrides/replace_button_edit_checkout.rb +10 -0
- data/app/overrides/replace_checkout_delivery_info.rb +6 -0
- data/app/overrides/replace_checkout_pay_button_with_dynamic_label.rb +14 -0
- data/app/overrides/replace_variant_not_available_button.rb +19 -0
- data/app/overrides/set_logo_width_height_in_admin_store_basic_form.rb +12 -0
- data/app/overrides/show_breadcrumbs_on_taxon_page.rb +30 -0
- data/app/overrides/show_individual_adjustments_in_order_details.rb +18 -0
- data/app/overrides/show_only_selected_payment_method_on_confirm.rb +29 -0
- data/app/overrides/spree/admin/preserve_filter_params_across_table_forms.rb +64 -0
- data/app/overrides/spree/admin/promotion_rules/_promotion_rule/set_turbo_frame_on_edit_link.html.erb.deface +11 -0
- data/app/overrides/spree/admin/stores/add_special_instruction_message_settings.rb +17 -0
- data/app/overrides/use_absolute_time_for_order_header_completed_at.rb +15 -0
- data/app/presenters/spree/mega_nav_presenter_decorator.rb +26 -0
- data/app/services/ba_spree/setup_service.rb +144 -0
- data/app/services/spree/assets/position_normalizer.rb +67 -0
- data/app/services/spree/products/duplicator_decorator.rb +39 -0
- data/app/services/spree/products/prepare_nested_attributes_decorator.rb +58 -0
- data/app/views/spree/addresses/edit.html.erb +64 -0
- data/app/views/spree/admin/orders/_order.html.erb +32 -0
- data/app/views/spree/admin/orders/_summary.html.erb +122 -0
- data/app/views/spree/admin/shared/_custom_head.html.erb +56 -0
- data/app/views/spree/admin/shared/sidebar/_promotions_nav.html.erb +55 -0
- data/app/views/spree/admin/stores/_special_instruction_message_settings.html.erb +14 -0
- data/app/views/spree/checkout/_accept_marketing_checkbox.html.erb +40 -0
- data/app/views/spree/checkout/_address.html.erb +135 -0
- data/app/views/spree/checkout/_confirm.html.erb +25 -0
- data/app/views/spree/checkout/_line_item.html.erb +26 -0
- data/app/views/spree/checkout/_payment_method_confirm.html.erb +8 -0
- data/app/views/spree/checkout/_payment_methods.html.erb +88 -0
- data/app/views/spree/checkout/_summary.html.erb +146 -0
- data/app/views/spree/shared/_purchased_items_table.html.erb +60 -0
- data/app/views/spree/shared/_purchased_items_table.text.erb +24 -0
- data/app/views/themes/default/spree/orders/_empty.html.erb +14 -0
- data/app/views/themes/default/spree/orders/_summary.html.erb +87 -0
- data/app/views/themes/default/spree/orders/edit.turbo_stream.erb +10 -0
- data/app/views/themes/default/spree/page_sections/_featured_taxons.html.erb +38 -0
- data/app/views/themes/default/spree/page_sections/_header.html.erb +124 -0
- data/app/views/themes/default/spree/page_sections/_newsletter.html.erb +4 -0
- data/app/views/themes/default/spree/page_sections/_post_details.html.erb +22 -0
- data/app/views/themes/default/spree/page_sections/_product_details.html.erb +88 -0
- data/app/views/themes/default/spree/page_sections/_product_grid.html.erb +58 -0
- data/app/views/themes/default/spree/page_sections/nav/_desktop.html.erb +94 -0
- data/app/views/themes/default/spree/page_sections/nav/_mobile.html.erb +148 -0
- data/app/views/themes/default/spree/posts/_post.html.erb +16 -0
- data/app/views/themes/default/spree/products/_description.html.erb +7 -0
- data/app/views/themes/default/spree/products/_details.html.erb +65 -0
- data/app/views/themes/default/spree/products/_json_ld_variant.html.erb +15 -0
- data/app/views/themes/default/spree/products/_price.html.erb +76 -0
- data/app/views/themes/default/spree/products/_swiper.html.erb +90 -0
- data/app/views/themes/default/spree/shared/_account_pane.html.erb +18 -0
- data/app/views/themes/default/spree/shared/_cart_icon.html.erb +19 -0
- data/app/views/themes/default/spree/shared/_line_item_options.html.erb +9 -0
- data/app/views/themes/default/spree/shared/_logo.html.erb +39 -0
- data/app/views/themes/default/spree/shared/_nav_taxon_square_image.html.erb +8 -0
- data/app/views/themes/default/spree/shared/_order_shipment.html.erb +79 -0
- data/app/views/themes/default/spree/shared/_search.html.erb +33 -0
- data/app/views/themes/default/spree/shared/icons/_cart.html.erb +6 -0
- data/app/views/themes/default/spree/shared/icons/_cart_48.html.erb +8 -0
- data/app/views/themes/default/spree/shared/icons/_heart.html.erb +15 -0
- data/config/importmap.rb +12 -0
- data/config/initializers/admin_navigation.rb +43 -0
- data/config/initializers/spree.rb +6 -0
- data/config/initializers/spree_admin_label_i18n_alias.rb +52 -0
- data/config/initializers/spree_admin_tables.rb +57 -0
- data/config/initializers/spree_permitted_attributes.rb +1 -0
- data/config/locales/en.yml +15 -0
- data/config/locales/ja.yml +18 -0
- data/config/locales/spree.en.yml +4 -0
- data/config/locales/spree.ja.yml +3493 -0
- data/lib/ba_spree/engine.rb +41 -0
- data/lib/ba_spree/spree_events_dedup_patch.rb +44 -0
- data/lib/ba_spree/version.rb +3 -0
- data/lib/ba_spree.rb +20 -0
- data/lib/generators/ba_spree/install/install_generator.rb +85 -0
- metadata +594 -0
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
<div class="py-2">
|
|
2
|
+
<%
|
|
3
|
+
# ゲストユーザーの場合: guest=true かつ deleted_at!=nil(論理削除されている)
|
|
4
|
+
# 会員の場合: guest!=true かつ deleted_at==nil
|
|
5
|
+
# 同じメールアドレスで既に購読済みなら表示しない
|
|
6
|
+
show_marketing_checkbox = false
|
|
7
|
+
if try_spree_current_user
|
|
8
|
+
# ログイン済みユーザー(会員)
|
|
9
|
+
show_marketing_checkbox = !try_spree_current_user.guest? && try_spree_current_user.deleted_at.nil? && !try_spree_current_user.accepts_email_marketing?
|
|
10
|
+
else
|
|
11
|
+
# 未ログインユーザー(ゲスト)
|
|
12
|
+
if @order.email.present?
|
|
13
|
+
existing_user = User.with_deleted.find_by(email: @order.email.downcase)
|
|
14
|
+
if existing_user
|
|
15
|
+
# 既存ユーザーがいる場合
|
|
16
|
+
if existing_user.guest? && existing_user.deleted_at.present?
|
|
17
|
+
# ゲストユーザーで論理削除されている場合、購読状況をチェック
|
|
18
|
+
show_marketing_checkbox = !existing_user.accepts_email_marketing?
|
|
19
|
+
end
|
|
20
|
+
else
|
|
21
|
+
# 新規ユーザーの場合は表示
|
|
22
|
+
show_marketing_checkbox = true
|
|
23
|
+
end
|
|
24
|
+
else
|
|
25
|
+
# メールアドレスが未入力の場合は表示
|
|
26
|
+
show_marketing_checkbox = true
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
%>
|
|
30
|
+
<% if show_marketing_checkbox %>
|
|
31
|
+
<div class="flex items-center gap-2">
|
|
32
|
+
<%= form.check_box :accept_marketing, { checked: true, class: 'checkbox-input' } %>
|
|
33
|
+
<%= form.label :accept_marketing, class: 'cursor-pointer text-sm select-none' do %>
|
|
34
|
+
<%= Spree.t('storefront.newsletter_subscription.join') %>
|
|
35
|
+
<% end %>
|
|
36
|
+
</div>
|
|
37
|
+
<% else %>
|
|
38
|
+
<%= form.hidden_field :accept_marketing, value: true %>
|
|
39
|
+
<% end %>
|
|
40
|
+
</div>
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
<%# @gem-override spree_storefront-5.3.6/app/views/spree/checkout/_address.html.erb %>
|
|
2
|
+
<%# reason: accept_marketing チェックボックスを共通 partial に切り出し、住所初期値を新規 Address 固定にするなどチェックアウト挙動を調整している %>
|
|
3
|
+
<%# @see https://github.com/be-agile/giga-repeat/commit/b0920403041181332b55b45773c3d0d2d0415970 %>
|
|
4
|
+
<%= render 'spree/checkout/quick_checkout' %>
|
|
5
|
+
|
|
6
|
+
<% address_type = 'shipping' %>
|
|
7
|
+
<% address_name = "#{address_type[0...4]}_address" %>
|
|
8
|
+
|
|
9
|
+
<% if @order.requires_ship_address? &&user_available_addresses.present? %>
|
|
10
|
+
<div data-controller="checkout-address-book">
|
|
11
|
+
<%= turbo_frame_tag :checkout_address_book do %>
|
|
12
|
+
<div class="mb-4" data-checkout-address-book-target="list">
|
|
13
|
+
<div id="<%= address_type %>">
|
|
14
|
+
<h5 class="font-body">
|
|
15
|
+
<%= Spree.t(address_type + '_address') %>
|
|
16
|
+
</h5>
|
|
17
|
+
<ul class="select_address list-group mb-5 border mt-3 rounded-md border-default">
|
|
18
|
+
<% user_available_addresses.each_with_index do |address, idx| %>
|
|
19
|
+
<%= render 'spree/checkout/address_list_item', address: address, idx: idx, order: @order, address_type: address_type, address_name: address_name %>
|
|
20
|
+
<% end %>
|
|
21
|
+
<li class="list-group-item p-0 m-0">
|
|
22
|
+
<div class="custom-control custom-radio px-5 py-4 flex items-center">
|
|
23
|
+
<%= radio_button_tag "order_#{address_name}_id", 0, false, class: 'custom-control-input radio-input mr-5', data: { action: 'checkout-address-book#select' } %>
|
|
24
|
+
<label class="custom-control-label d-block select-none cursor-pointer w-full max-w-[calc(100%-58px)]" for="<%= "order_#{address_name}_id_0" %>">
|
|
25
|
+
<%= Spree.t(:new_address) %>
|
|
26
|
+
<div class="mt-4 hidden" data-checkout-address-book-target="newAddressForm">
|
|
27
|
+
<%= turbo_frame_tag :new_address do %>
|
|
28
|
+
<%= form_for try_spree_current_user.addresses.build(country: current_store.default_country), html: { id: 'checkout_form_address' } do |f| %>
|
|
29
|
+
<%= render 'spree/addresses/form',
|
|
30
|
+
address_name: 'address',
|
|
31
|
+
address_form: f,
|
|
32
|
+
address_type: 'shipping',
|
|
33
|
+
address: @address %>
|
|
34
|
+
<%= hidden_field_tag :order_token, @order.token %>
|
|
35
|
+
<%= hidden_field_tag "default_shipping", true %>
|
|
36
|
+
<%= hidden_field_tag "default_billing", true %>
|
|
37
|
+
<%= f.submit Spree.t('actions.save'), class: 'btn btn-primary btn-block spree-btn mb-5' %>
|
|
38
|
+
<% end %>
|
|
39
|
+
<% end %>
|
|
40
|
+
</div>
|
|
41
|
+
</label>
|
|
42
|
+
</div>
|
|
43
|
+
</li>
|
|
44
|
+
</ul>
|
|
45
|
+
</div>
|
|
46
|
+
</div>
|
|
47
|
+
<% end %>
|
|
48
|
+
|
|
49
|
+
<%= form_for @order, url: spree.update_checkout_path(@order.token, @order.state), html: { id: "checkout_form_#{@order.state}" } do |form| %>
|
|
50
|
+
<div>
|
|
51
|
+
<%= render 'spree/checkout/order_lock_version', order: @order %>
|
|
52
|
+
<%= form.hidden_field :ship_address_id, data: { 'checkout-address-book-target': 'addressId' } %>
|
|
53
|
+
</div>
|
|
54
|
+
|
|
55
|
+
<%= render 'spree/checkout/special_instructions', form: form %>
|
|
56
|
+
|
|
57
|
+
<%= render 'spree/checkout/accept_marketing_checkbox', form: form %>
|
|
58
|
+
|
|
59
|
+
<div>
|
|
60
|
+
<%= button_tag Spree.t(:save_and_continue),
|
|
61
|
+
data: {
|
|
62
|
+
'checkout-address-book-target': 'submit',
|
|
63
|
+
'turbo-submits-with': (render 'spree/checkout/button_processing', is_hidden: false)
|
|
64
|
+
},
|
|
65
|
+
class: 'btn btn-primary font-weight-bold w-full lg:w-48 float-right checkout-content-save-continue-button',
|
|
66
|
+
disabled: @order.ship_address_id.nil? %>
|
|
67
|
+
</div>
|
|
68
|
+
<% end %>
|
|
69
|
+
</div>
|
|
70
|
+
<% else %>
|
|
71
|
+
<%= form_for @order, url: spree.update_checkout_path(@order.token, @order.state), html: { id: "checkout_form_#{@order.state}" } do |form| %>
|
|
72
|
+
<%= render 'spree/checkout/order_lock_version', order: @order %>
|
|
73
|
+
<div class="mb-5">
|
|
74
|
+
<% if !try_spree_current_user || try_spree_current_user.email.blank? %>
|
|
75
|
+
<div class="grid grid-cols-1 lg:grid-cols-2 mb-3 font-body">
|
|
76
|
+
<h5 class="font-body">
|
|
77
|
+
<%= Spree.t(:contact_information) %>
|
|
78
|
+
</h5>
|
|
79
|
+
<% if !already_have_an_account? && defined?(spree_login_path) %>
|
|
80
|
+
<div class="lg:text-right">
|
|
81
|
+
<span class="text-muted text-sm">
|
|
82
|
+
<%= Spree.t('storefront.checkout.already_have_an_account') %> <span class="text-primary"><%= link_to Spree.t(:login), spree_login_path, data: { turbo_frame: '_top' } %></span>
|
|
83
|
+
</span>
|
|
84
|
+
</div>
|
|
85
|
+
<% end %>
|
|
86
|
+
</div>
|
|
87
|
+
<div class="form-group has-float-label mb-3">
|
|
88
|
+
<%= form.email_field :email, class: 'w-full text-input', required: true, placeholder: Spree.t(:email), id: 'order_ship_address_attributes_email' %>
|
|
89
|
+
<label for="order_ship_address_attributes_email"><%= Spree.t(:email) %></label>
|
|
90
|
+
</div>
|
|
91
|
+
<% end %>
|
|
92
|
+
|
|
93
|
+
<%= render 'spree/checkout/accept_marketing_checkbox', form: form %>
|
|
94
|
+
|
|
95
|
+
<% unless try_spree_current_user %>
|
|
96
|
+
<% if already_have_an_account? %>
|
|
97
|
+
<div class="py-2 text-sm">
|
|
98
|
+
<%= Spree.t("storefront.checkout.it_seems_you_already_have_an_account_html", link: link_to(Spree.t(:login), spree_login_path, class: 'text-primary font-semibold')) %>
|
|
99
|
+
</div>
|
|
100
|
+
<% end %>
|
|
101
|
+
<% end %>
|
|
102
|
+
|
|
103
|
+
<% if @order.requires_ship_address? %>
|
|
104
|
+
<div class="mb-4" data-controller="checkout-address-book" data-checkout-address-book-target="list">
|
|
105
|
+
<div id="<%= address_type %>">
|
|
106
|
+
<h5 class="mt-5 mb-4 font-body">
|
|
107
|
+
<%= Spree.t(address_type + '_address') %>
|
|
108
|
+
</h5>
|
|
109
|
+
<%= form.fields_for address_name do |address_form| %>
|
|
110
|
+
<div class="inner checkout-content-inner" data-hook='<%= "#{address_type}_inner" %>'>
|
|
111
|
+
<%= render partial: 'spree/addresses/form', locals: {
|
|
112
|
+
address_name: address_name,
|
|
113
|
+
address_form: address_form,
|
|
114
|
+
address_type: address_type,
|
|
115
|
+
address: Spree::Address.new(country: current_store.default_country, user: try_spree_current_user),
|
|
116
|
+
form: form
|
|
117
|
+
} %>
|
|
118
|
+
</div>
|
|
119
|
+
<% end %>
|
|
120
|
+
</div>
|
|
121
|
+
</div>
|
|
122
|
+
<%= hidden_field_tag 'save_user_address', true, data: { hook: "save_user_address" } %>
|
|
123
|
+
<% end %>
|
|
124
|
+
|
|
125
|
+
<%= render 'spree/checkout/special_instructions', form: form %>
|
|
126
|
+
</div>
|
|
127
|
+
<div class="flex justify-end w-full gap-2">
|
|
128
|
+
<%= button_tag Spree.t(:save_and_continue),
|
|
129
|
+
class: 'btn-primary w-full lg:w-2/5 font-semibold checkout-content-save-continue-button my-5 !py-4',
|
|
130
|
+
data: {
|
|
131
|
+
'turbo-submits-with': (render 'spree/checkout/button_processing', is_hidden: false)
|
|
132
|
+
} %>
|
|
133
|
+
</div>
|
|
134
|
+
<% end %>
|
|
135
|
+
<% end %>
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
<%= form_for @order, url: spree.update_checkout_path(@order.token, @order.state), html: { id: "checkout_form_#{@order.state}" } do |form| %>
|
|
2
|
+
<%= form.hidden_field :state_lock_version %>
|
|
3
|
+
|
|
4
|
+
<% if @order.respond_to?(:gift_card) %>
|
|
5
|
+
<%= turbo_frame_tag :gift_card_code_field do %>
|
|
6
|
+
<%= hidden_field_tag 'order[gift_card_code]', @order.gift_card&.code %>
|
|
7
|
+
<%= hidden_field_tag 'order[gift_card_amount]', @order.gift_card_total %>
|
|
8
|
+
<% end %>
|
|
9
|
+
<% end %>
|
|
10
|
+
|
|
11
|
+
<% use_shipping = @order.shipping_eq_billing_address? || @order.bill_address.nil? || @order.bill_address.new_record? %>
|
|
12
|
+
|
|
13
|
+
<div class="border text-sm px-5 mb-6 py-4 rounded-md border-default">
|
|
14
|
+
<div class="flex items-center">
|
|
15
|
+
<div class="min-w-[60px] max-w-[60px]">
|
|
16
|
+
<%= Spree.t(:bill_address) %>
|
|
17
|
+
</div>
|
|
18
|
+
<div class="px-5 word-break">
|
|
19
|
+
<%= @order.bill_address.to_s.gsub('<br/>', I18n.t("address_format_i18n.delimiter", default: " ")).html_safe %>
|
|
20
|
+
</div>
|
|
21
|
+
</div>
|
|
22
|
+
</div>
|
|
23
|
+
|
|
24
|
+
<%= render 'spree/checkout/payment_methods', form: form %>
|
|
25
|
+
<% end %>
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
<%# @gem-override spree_storefront-5.3.6/app/views/spree/checkout/_line_item.html.erb %>
|
|
2
|
+
<%# reason: カート明細のサムネイルサイズ (64→60) と価格表示を pre_tax_amount から Spree::Money(line_item.amount) に変更している %>
|
|
3
|
+
<%# note: 5.3 で本家は spree_image_tag に variant: :mini (128px の preprocessed named variant) を追加したが、 %>
|
|
4
|
+
<%# variant 指定は width/height を無視するため ba_spree の 60px サムネイル方針と競合する。 %>
|
|
5
|
+
<%# 60px の動的 variant を維持するため variant: :mini は取り込まない。 %>
|
|
6
|
+
<%# @see https://github.com/be-agile/giga-repeat/commit/46ac63582aa36aea93e250a14274626e98c5207a %>
|
|
7
|
+
<div class="flex justify-between items-center pt-3">
|
|
8
|
+
<div class="mr-5 w-[60px] h-[60px] relative rounded bg-accent-100 shrink-0">
|
|
9
|
+
<span class="rounded-full text-xs text-center font-bold pl-[0.5px] py-1 w-6 text-sidebar-text bg-background absolute -right-2 -top-3">
|
|
10
|
+
<%= line_item.quantity %>
|
|
11
|
+
</span>
|
|
12
|
+
<% image = line_item.variant.default_image %>
|
|
13
|
+
<% if image.present? && image.attached? && image.variable? %>
|
|
14
|
+
<%= spree_image_tag(image, class: 'rounded border border-default bg-transparent object-cover object-center', loading: :lazy, width: 60, height: 60) %>
|
|
15
|
+
<% else %>
|
|
16
|
+
<div style="width:60px;height:60px;" class="bg-accent-100 border border-default rounded"></div>
|
|
17
|
+
<% end %>
|
|
18
|
+
</div>
|
|
19
|
+
<div class="flex-1 pr-3 text-sm">
|
|
20
|
+
<p class="font-bold word-break"><%= line_item.name %></p>
|
|
21
|
+
<p class="text-xs"><%= line_item.options_text %></p>
|
|
22
|
+
</div>
|
|
23
|
+
<div class="font-semibold text-sm text-right shrink-0">
|
|
24
|
+
<%= Spree::Money.new(line_item.amount, currency: line_item.currency) %>
|
|
25
|
+
</div>
|
|
26
|
+
</div>
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
<li class="list-group-item p-0 m-0 border-b border-default">
|
|
2
|
+
<div class="px-5 py-4">
|
|
3
|
+
<div class="font-medium mb-2">
|
|
4
|
+
<%= Spree.t(method.name, scope: :payment_methods, default: method.name) %>
|
|
5
|
+
</div>
|
|
6
|
+
<%= render partial: "spree/checkout/payment/#{method.method_type}", locals: { payment_method: method } %>
|
|
7
|
+
</div>
|
|
8
|
+
</li>
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
<%# @gem-override spree_storefront-5.3.6/app/views/spree/checkout/_payment_methods.html.erb %>
|
|
2
|
+
<%# reason: confirm 画面ではラジオなしの確認表示、それ以外は選択用ラジオ表示と、注文状態で支払い方法 UI を分岐させている %>
|
|
3
|
+
<%# @see https://github.com/be-agile/giga-repeat/issues/994 %>
|
|
4
|
+
<%= turbo_frame_tag :checkout_payment_methods do %>
|
|
5
|
+
<% if !@order.payment_required? && @order.using_store_credit? %>
|
|
6
|
+
<div class="d-flex flex-column mb-5">
|
|
7
|
+
<p>
|
|
8
|
+
<% if @order.respond_to?(:gift_card) && @order.gift_card.present? %>
|
|
9
|
+
<%= Spree.t('storefront.checkout.gift_card_amount_applied', amount: @order.display_gift_card_total, code: @order.gift_card.code) %>
|
|
10
|
+
<% else %>
|
|
11
|
+
<%= Spree.t('storefront.checkout.store_credits_amount_applied', amount: @order.display_total_applicable_store_credit.abs) %>
|
|
12
|
+
<% end %>
|
|
13
|
+
|
|
14
|
+
<%= Spree.t('storefront.checkout.order_already_paid') %>
|
|
15
|
+
</p>
|
|
16
|
+
</div>
|
|
17
|
+
<div class="flex justify-end w-full">
|
|
18
|
+
<%= button_tag Spree.t(:place_order),
|
|
19
|
+
class: 'btn-primary w-full lg:w-2/5 font-semibold checkout-content-save-continue-button my-5 !py-4',
|
|
20
|
+
data: { 'turbo-submits-with': (render 'spree/checkout/button_processing', is_hidden: false) } %>
|
|
21
|
+
</div>
|
|
22
|
+
<% else %>
|
|
23
|
+
<h5 class="mb-3 font-body font-semibold">
|
|
24
|
+
<%= Spree.t(:payment) %>
|
|
25
|
+
</h5>
|
|
26
|
+
<p class="text-muted mb-3 text-neutral-600">
|
|
27
|
+
<%= Spree.t('storefront.checkout.all_transactions_are_secure_and_encrypted') %>
|
|
28
|
+
</p>
|
|
29
|
+
|
|
30
|
+
<%= render partial: 'spree/checkout/payment/store_credit' %>
|
|
31
|
+
|
|
32
|
+
<% if @order.state == 'confirm' %>
|
|
33
|
+
<!-- 確認画面: シンプルな支払い方法表示(ラジオボタンなし) -->
|
|
34
|
+
<% if checkout_available_payment_methods.size > 1 %>
|
|
35
|
+
<ul id="payment-method-fields" class="rounded-md list-group mb-4 border border-default text-sm">
|
|
36
|
+
<% selected_method = checkout_available_payment_methods.find { |method| @order.payments.valid.any? { |p| p.payment_method_id == method.id } } || checkout_available_payment_methods.first %>
|
|
37
|
+
<%= render collection: checkout_available_payment_methods.select { |method| @order.payments.valid.any? { |p| p.payment_method_id == method.id } }, partial: 'spree/checkout/payment_method_confirm', as: :method, locals: { selected_method: selected_method } %>
|
|
38
|
+
</ul>
|
|
39
|
+
<% elsif checkout_available_payment_methods.any? %>
|
|
40
|
+
<%= hidden_field_tag "order[payments_attributes][][payment_method_id]", checkout_available_payment_methods.first&.id %>
|
|
41
|
+
<div class="mb-4">
|
|
42
|
+
<div class="font-medium mb-2">
|
|
43
|
+
<%= Spree.t(checkout_available_payment_methods.first.name, scope: :payment_methods, default: checkout_available_payment_methods.first.name) %>
|
|
44
|
+
</div>
|
|
45
|
+
<%= render partial: "spree/checkout/payment/#{checkout_available_payment_methods.first.method_type}", locals: { payment_method: checkout_available_payment_methods.first } %>
|
|
46
|
+
</div>
|
|
47
|
+
<% end %>
|
|
48
|
+
<% else %>
|
|
49
|
+
<!-- 支払い方法選択画面: 通常のラジオボタン付きリスト -->
|
|
50
|
+
<% if checkout_available_payment_methods.size > 1 %>
|
|
51
|
+
<ul id="payment-method-fields" class="rounded-md list-group mb-4 border border-default border-b-0 text-sm border-default">
|
|
52
|
+
<%
|
|
53
|
+
# spree_products_payment_methodsエンジンのフィルタリングロジックを適用
|
|
54
|
+
filtered_methods = if @order.respond_to?(:availiable_products_payment_methods)
|
|
55
|
+
checkout_available_payment_methods.to_a & @order.availiable_products_payment_methods.to_a
|
|
56
|
+
else
|
|
57
|
+
checkout_available_payment_methods
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
selected_method = if params[:payment_method_id].present?
|
|
61
|
+
filtered_methods.find { |method| method.id.to_s == params[:payment_method_id].to_s }
|
|
62
|
+
elsif @order.payment_method.present?
|
|
63
|
+
filtered_methods.find { |method| method.id == @order.payment_method.id }
|
|
64
|
+
else
|
|
65
|
+
filtered_methods.first
|
|
66
|
+
end
|
|
67
|
+
%>
|
|
68
|
+
<%= render collection: filtered_methods, partial: 'spree/checkout/payment_method', as: :method, locals: { selected_method: selected_method } %>
|
|
69
|
+
</ul>
|
|
70
|
+
<% elsif checkout_available_payment_methods.any? %>
|
|
71
|
+
<%= hidden_field_tag "order[payments_attributes][][payment_method_id]", checkout_available_payment_methods.first&.id %>
|
|
72
|
+
<%= render partial: "spree/checkout/payment/#{checkout_available_payment_methods.first.method_type}", locals: { payment_method: checkout_available_payment_methods.first } %>
|
|
73
|
+
<% end %>
|
|
74
|
+
<% end %>
|
|
75
|
+
<% end %>
|
|
76
|
+
|
|
77
|
+
<%= render 'spree/checkout/terms_and_conditions' %>
|
|
78
|
+
|
|
79
|
+
<div class="flex justify-end w-full gap-2">
|
|
80
|
+
<button type="submit"
|
|
81
|
+
id="checkout-payment-submit"
|
|
82
|
+
class="btn-primary w-full lg:w-2/5 font-semibold checkout-content-save-continue-button my-5 !py-4"
|
|
83
|
+
>
|
|
84
|
+
<%= render 'button_processing', is_hidden: true %>
|
|
85
|
+
<%= @order.state == 'confirm' ? Spree.t(:place_order) : Spree.t(:pay) %>
|
|
86
|
+
</button>
|
|
87
|
+
</div>
|
|
88
|
+
<% end %>
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
<%# @gem-override spree_storefront-5.3.6/app/views/spree/checkout/_summary.html.erb %>
|
|
2
|
+
<%# reason: 注文状態 (address/delivery/payment/confirm/complete) ごとに小計・調整・税・合計の算出と表示を作り分けている %>
|
|
3
|
+
<%# @see https://github.com/be-agile/giga-repeat/commit/e6cedf7043ffca764a28841deb78005d66b87a79 %>
|
|
4
|
+
<%= turbo_frame_tag :checkout_summary, id: 'summary' do %>
|
|
5
|
+
<div class="checkout-content-summary text-sm">
|
|
6
|
+
<% cache [*spree_storefront_base_cache_scope.call(order.cache_key_with_version), order.state] do %>
|
|
7
|
+
<div data-hook="order_summary">
|
|
8
|
+
<div class="flex justify-between items-center mb-2">
|
|
9
|
+
<span><%= Spree.t(:subtotal) %>:</span>
|
|
10
|
+
<span><%= order.display_item_total.to_html %></span>
|
|
11
|
+
</div>
|
|
12
|
+
<div class="d-table-cell text-right font-weight-bold"></div>
|
|
13
|
+
|
|
14
|
+
<% cache spree_storefront_base_cache_scope.call(order.line_item_adjustments.nonzero.cache_key_with_version) do %>
|
|
15
|
+
<% if order.line_item_adjustments.nonzero.exists? %>
|
|
16
|
+
<% order.line_item_adjustments.nonzero.promotion.eligible.group_by(&:label).each do |label, adjustments| %>
|
|
17
|
+
<div class="flex justify-between items-center mb-2">
|
|
18
|
+
<span class="max-w-[250px] truncate">
|
|
19
|
+
<%= label %>:
|
|
20
|
+
</span>
|
|
21
|
+
<span>
|
|
22
|
+
<%= Spree::Money.new(adjustments.sum(&:amount), currency: order.currency).to_html %>
|
|
23
|
+
</span>
|
|
24
|
+
</div>
|
|
25
|
+
<% end %>
|
|
26
|
+
<% end %>
|
|
27
|
+
<% end %>
|
|
28
|
+
|
|
29
|
+
<% if order.state == 'confirm' || order.state == 'complete' %>
|
|
30
|
+
<% if order.adjustments.nonzero.non_tax.eligible.exists? %>
|
|
31
|
+
<% sort_adjustments_with_flat_percent_last(order.adjustments.nonzero.non_tax.eligible).each do |adjustment| %>
|
|
32
|
+
<div class="flex justify-between items-center mb-2">
|
|
33
|
+
<span>
|
|
34
|
+
<%= adjustment.label %>:
|
|
35
|
+
</span>
|
|
36
|
+
<span>
|
|
37
|
+
<%= adjustment.display_amount.to_html %>
|
|
38
|
+
</span>
|
|
39
|
+
</div>
|
|
40
|
+
<% end %>
|
|
41
|
+
<% end %>
|
|
42
|
+
<% else %>
|
|
43
|
+
<% if order.adjustments.nonzero.non_tax.non_payment_method.eligible.exists? %>
|
|
44
|
+
<% sort_adjustments_with_flat_percent_last(order.adjustments.nonzero.non_tax.non_payment_method.eligible).each do |adjustment| %>
|
|
45
|
+
<div class="flex justify-between items-center mb-2">
|
|
46
|
+
<span>
|
|
47
|
+
<%= adjustment.label %>:
|
|
48
|
+
</span>
|
|
49
|
+
<span>
|
|
50
|
+
<%= adjustment.display_amount.to_html %>
|
|
51
|
+
</span>
|
|
52
|
+
</div>
|
|
53
|
+
<% end %>
|
|
54
|
+
<% end %>
|
|
55
|
+
<% end %>
|
|
56
|
+
|
|
57
|
+
<% if !(order.state == 'address' || order.state == 'delivery') && order.shipments.any? %>
|
|
58
|
+
<% if order.has_free_shipping? %>
|
|
59
|
+
<div class="flex justify-between items-center mb-2">
|
|
60
|
+
<span><%= Spree.t(:shipping) %>:</span>
|
|
61
|
+
<span><%= Spree.t(:free) %></span>
|
|
62
|
+
</div>
|
|
63
|
+
<% else %>
|
|
64
|
+
<div class="flex justify-between items-center mb-2">
|
|
65
|
+
<span><%= Spree.t(:shipping) %>:</span>
|
|
66
|
+
<span>
|
|
67
|
+
<%= order.ship_total <= 0 ? Spree.t(:free) : order.display_ship_total.to_html %>
|
|
68
|
+
</span>
|
|
69
|
+
</div>
|
|
70
|
+
|
|
71
|
+
<% if order.shipment_adjustments.nonzero.exists? %>
|
|
72
|
+
<% order.shipment_adjustments.nonzero.promotion.eligible.group_by(&:label).each do |label, adjustments| %>
|
|
73
|
+
<div class="flex justify-between items-center mb-2">
|
|
74
|
+
<span>
|
|
75
|
+
<%= label %>:
|
|
76
|
+
</span>
|
|
77
|
+
<span>
|
|
78
|
+
<%= Spree::Money.new(adjustments.sum(&:amount), currency: order.currency).to_html %>
|
|
79
|
+
</span>
|
|
80
|
+
<% end %>
|
|
81
|
+
<% end %>
|
|
82
|
+
<% end %>
|
|
83
|
+
<% end %>
|
|
84
|
+
|
|
85
|
+
<% if order.respond_to?(:gift_card) && order.gift_card.present? %>
|
|
86
|
+
<div class="flex justify-between items-center mb-2">
|
|
87
|
+
<span><%= Spree.t(:gift_card) %>:</span>
|
|
88
|
+
<span>-<%= order.display_gift_card_total %></span>
|
|
89
|
+
</div>
|
|
90
|
+
<% elsif order.using_store_credit? %>
|
|
91
|
+
<div class="flex justify-between items-center mb-2">
|
|
92
|
+
<span>Store credit:</span>
|
|
93
|
+
<span><%= order.display_total_applied_store_credit %></span>
|
|
94
|
+
</div>
|
|
95
|
+
<% end %>
|
|
96
|
+
|
|
97
|
+
<div>
|
|
98
|
+
<div class="flex justify-between items-center">
|
|
99
|
+
<span class="font-bold text-lg"><%= Spree.t(:total) %></span>
|
|
100
|
+
<div class="">
|
|
101
|
+
<span class="font-semibold text-lg inline" id='summary-order-total' data-currency="<%= Money::Currency.find(order.currency).symbol %>">
|
|
102
|
+
<% if order.address? %>
|
|
103
|
+
<% line_item_adj_total = BigDecimal(order.line_item_adjustments.nonzero.promotion.eligible.sum(:amount).to_s).round(2, BigDecimal::ROUND_HALF_UP) %>
|
|
104
|
+
<% order_adj_total = BigDecimal(order.adjustments.nonzero.non_tax.non_payment_method.eligible.sum(:amount).to_s).round(2, BigDecimal::ROUND_HALF_UP) %>
|
|
105
|
+
<%= Spree::Money.new(order.item_total + line_item_adj_total + order_adj_total, currency: order.currency).to_html %>
|
|
106
|
+
<% elsif order.delivery? %>
|
|
107
|
+
<% line_item_adj_total = BigDecimal(order.line_item_adjustments.nonzero.promotion.eligible.sum(:amount).to_s).round(2, BigDecimal::ROUND_HALF_UP) %>
|
|
108
|
+
<% order_adj_total = BigDecimal(order.adjustments.nonzero.non_tax.non_payment_method.eligible.sum(:amount).to_s).round(2, BigDecimal::ROUND_HALF_UP) %>
|
|
109
|
+
<%= Spree::Money.new(order.item_total + line_item_adj_total + order_adj_total, currency: order.currency).to_html %>
|
|
110
|
+
<% elsif order.payment? %>
|
|
111
|
+
<% line_item_adj_total = BigDecimal(order.line_item_adjustments.nonzero.promotion.eligible.sum(:amount).to_s).round(2, BigDecimal::ROUND_HALF_UP) %>
|
|
112
|
+
<% order_adj_total = BigDecimal(order.adjustments.nonzero.non_tax.non_payment_method.eligible.sum(:amount).to_s).round(2, BigDecimal::ROUND_HALF_UP) %>
|
|
113
|
+
<%= Spree::Money.new(order.item_total + order.shipment_total + line_item_adj_total + order_adj_total, currency: order.currency).to_html %>
|
|
114
|
+
<% else %>
|
|
115
|
+
<%= order.display_total_minus_store_credits.to_html %>
|
|
116
|
+
<% end %>
|
|
117
|
+
</span>
|
|
118
|
+
</div>
|
|
119
|
+
</div>
|
|
120
|
+
</div>
|
|
121
|
+
</div>
|
|
122
|
+
<% end %>
|
|
123
|
+
|
|
124
|
+
<%# キャッシュキーに order.state を含める: 税の表示を confirm/complete のみに絞っているため、
|
|
125
|
+
payment 状態(税は確定済みだが非表示)で先にこのフラグメントが「空」でキャッシュされると、
|
|
126
|
+
税 adjustment 集合が同一(= cache_key_with_version も同一)の confirm でも空キャッシュが
|
|
127
|
+
再利用され内税が出なくなる(クレカ決済等 payment に滞在してから confirm に進む経路で顕在化)。
|
|
128
|
+
state をキーに加え payment と confirm を分離する。本家は税表示を payment? でも出すため衝突しない。 %>
|
|
129
|
+
<% cache [spree_base_cache_scope.call(order.all_adjustments.nonzero.tax.eligible.cache_key_with_version), order.state] do %>
|
|
130
|
+
<% if order.state == 'confirm' || order.state == 'complete' %>
|
|
131
|
+
<% taxes = order.all_adjustments.nonzero.tax.eligible.group_by(&:label) %>
|
|
132
|
+
<% taxes.each do |label, adjustments| %>
|
|
133
|
+
<div class="flex justify-between items-center mb-2">
|
|
134
|
+
<span><%= label %></span>
|
|
135
|
+
<% tax_total = Spree::Money.new(adjustments.sum(&:amount), currency: order.currency) %>
|
|
136
|
+
<span><%= tax_total.to_html %></span>
|
|
137
|
+
</div>
|
|
138
|
+
<% end %>
|
|
139
|
+
<% end %>
|
|
140
|
+
<% end %>
|
|
141
|
+
|
|
142
|
+
<div id="checkout-message" class="mt-8">
|
|
143
|
+
<%= current_store.checkout_message if current_store.checkout_message.present? %>
|
|
144
|
+
</div>
|
|
145
|
+
</div>
|
|
146
|
+
<% end %>
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
<%# @gem-override spree_emails-5.3.6/app/views/spree/shared/_purchased_items_table.html.erb %>
|
|
2
|
+
<%# reason: メール明細の割引集計を all_adjustments から line_item_adjustments / 調整 partial / 税ラベル別集計に組み替えている %>
|
|
3
|
+
<%# @see https://github.com/be-agile/giga-repeat/commit/8f447188bc31d60e0ce4af8e9d5377d34360433d %>
|
|
4
|
+
<table class="purchase_content">
|
|
5
|
+
<%= render collection: line_items, partial: 'spree/shared/purchased_items_table/line_item', as: :line_item %>
|
|
6
|
+
<%= render 'spree/shared/purchased_items_table/subtotal', order: order %>
|
|
7
|
+
<% if order.line_item_adjustments.exists? %>
|
|
8
|
+
<% if order.line_item_adjustments.promotion.eligible.exists? %>
|
|
9
|
+
<% order.line_item_adjustments.promotion.eligible.group_by(&:label).each do |label, adjustments| %>
|
|
10
|
+
<tr>
|
|
11
|
+
<td></td>
|
|
12
|
+
<td>
|
|
13
|
+
<p class="f-fallback purchase_total purchase_total--label">
|
|
14
|
+
<%= label %>:
|
|
15
|
+
</p>
|
|
16
|
+
</td>
|
|
17
|
+
<td class="purchase_total-col">
|
|
18
|
+
<p class="f-fallback purchase_total">
|
|
19
|
+
<%= Spree::Money.new(adjustments.sum(&:amount), currency: order.currency) %>
|
|
20
|
+
</p>
|
|
21
|
+
</td>
|
|
22
|
+
</tr>
|
|
23
|
+
<% end %>
|
|
24
|
+
<% end %>
|
|
25
|
+
<% end %>
|
|
26
|
+
<% sort_adjustments_with_flat_percent_last(order.adjustments.eligible.non_tax.non_zero).each do |adjustment| %>
|
|
27
|
+
<%= render 'spree/shared/purchased_items_table/adjustment', adjustment: adjustment, order: order %>
|
|
28
|
+
<% end %>
|
|
29
|
+
<% order.shipments.group_by { |s| s.selected_shipping_rate&.name }.each do |name, shipments| %>
|
|
30
|
+
<tr>
|
|
31
|
+
<td></td>
|
|
32
|
+
<td>
|
|
33
|
+
<p class="f-fallback purchase_total purchase_total--label">
|
|
34
|
+
<%= name %>:
|
|
35
|
+
</p>
|
|
36
|
+
</td>
|
|
37
|
+
<td class="purchase_total-col">
|
|
38
|
+
<p class="f-fallback purchase_total">
|
|
39
|
+
<%= Spree::Money.new(shipments.sum(&:discounted_cost), currency: order.currency) %>
|
|
40
|
+
</p>
|
|
41
|
+
</td>
|
|
42
|
+
</tr>
|
|
43
|
+
<% end %>
|
|
44
|
+
<% order.all_adjustments.nonzero.tax.eligible.group_by(&:label).each do |label, adjustments| %>
|
|
45
|
+
<tr>
|
|
46
|
+
<td></td>
|
|
47
|
+
<td>
|
|
48
|
+
<p class="f-fallback purchase_total purchase_total--label">
|
|
49
|
+
<%= label %>:
|
|
50
|
+
</p>
|
|
51
|
+
</td>
|
|
52
|
+
<td class="purchase_total-col">
|
|
53
|
+
<p class="f-fallback purchase_total">
|
|
54
|
+
<%= Spree::Money.new(adjustments.sum(&:amount), currency: order.currency).to_html %>
|
|
55
|
+
</p>
|
|
56
|
+
</td>
|
|
57
|
+
</tr>
|
|
58
|
+
<% end %>
|
|
59
|
+
<%= render 'spree/shared/purchased_items_table/total', order: order %>
|
|
60
|
+
</table>
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
<%# @gem-override spree_emails-5.3.6/app/views/spree/shared/_purchased_items_table.text.erb %>
|
|
2
|
+
<%# reason: テキストメール明細の数量・割引・送料・税の表示を line_item_adjustments ベースに組み替えている %>
|
|
3
|
+
<%# @see https://github.com/be-agile/giga-repeat/commit/8f447188bc31d60e0ce4af8e9d5377d34360433d %>
|
|
4
|
+
<% line_items.each do |item| %>
|
|
5
|
+
<%= item.variant.sku %> <%= raw(item.variant.product.name) %> <%= raw(item.variant.options_text) -%> (<%=item.quantity%> x <%= item.single_money %>) = <%= item.display_amount %>
|
|
6
|
+
<% end %>
|
|
7
|
+
============================================================
|
|
8
|
+
<%= Spree.t('order_mailer.subtotal') %> <%= order.display_item_total %>
|
|
9
|
+
<% if order.line_item_adjustments.exists? %>
|
|
10
|
+
<% if order.line_item_adjustments.promotion.eligible.exists? %>
|
|
11
|
+
<% order.line_item_adjustments.promotion.eligible.group_by(&:label).each do |label, adjustments| %>
|
|
12
|
+
<%= label %>: <%= Spree::Money.new(adjustments.sum(&:amount), currency: order.currency) %>
|
|
13
|
+
<% end %>
|
|
14
|
+
<% end %>
|
|
15
|
+
<% end %>
|
|
16
|
+
<% sort_adjustments_with_flat_percent_last(order.adjustments.eligible.non_tax.non_zero).each do |adjustment| %>
|
|
17
|
+
<%= adjustment.label %> <%= adjustment.display_amount %>
|
|
18
|
+
<% end %>
|
|
19
|
+
<% order.shipments.group_by { |s| s.selected_shipping_rate.try(:name) }.each do |name, shipments| %>
|
|
20
|
+
<%= Spree.t(:shipping) %>: <%= name %> <%= Spree::Money.new(shipments.sum(&:discounted_cost), currency: order.currency) %>
|
|
21
|
+
<% end %>
|
|
22
|
+
<% order.all_adjustments.nonzero.tax.eligible.group_by(&:label).each do |label, adjustments| %>
|
|
23
|
+
<%= label %>: <%= Spree::Money.new(adjustments.sum(&:amount), currency: order.currency).to_html %>
|
|
24
|
+
<% end %>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
<%# @gem-override spree_storefront-5.3.6/app/views/themes/default/spree/orders/_empty.html.erb %>
|
|
2
|
+
<%# reason: 空カート表示を本家からコピーした丸ごと上書き (本家と現状差分なし) %>
|
|
3
|
+
<%# @see https://github.com/be-agile/giga-repeat/commit/f7ea162f7ef78b6e1883a8fd5a02ada9a7ad017e %>
|
|
4
|
+
<div class="flex flex-col justify-between h-full">
|
|
5
|
+
<div class="h-full flex flex-col items-center place-content-center py-10">
|
|
6
|
+
<%= render 'spree/shared/icons/cart_48' %>
|
|
7
|
+
<p class="mb-8 mt-4 uppercase text-sm">
|
|
8
|
+
<%= Spree.t('cart_page.empty_info').html_safe %>
|
|
9
|
+
</p>
|
|
10
|
+
<div class="mx-10">
|
|
11
|
+
<%= link_to Spree.t(:continue_shopping), spree.products_path, class: 'btn-primary !no-underline', data: { 'turbo-frame': '_top' } %>
|
|
12
|
+
</div>
|
|
13
|
+
</div>
|
|
14
|
+
</div>
|