diff --git a/app/assets/images/edit-with-pen.svg b/app/assets/images/edit-with-pen.svg new file mode 100644 index 0000000000..2d6b7dae9f --- /dev/null +++ b/app/assets/images/edit-with-pen.svg @@ -0,0 +1,3 @@ + + + diff --git a/app/assets/stylesheets/darkswarm/split-checkout.scss b/app/assets/stylesheets/darkswarm/split-checkout.scss index d8cb8b4575..c9b0dd533d 100644 --- a/app/assets/stylesheets/darkswarm/split-checkout.scss +++ b/app/assets/stylesheets/darkswarm/split-checkout.scss @@ -113,6 +113,11 @@ white-space: pre-wrap; } } + + a { + color: $teal-400; + text-decoration: underline; + } } .checkout-submit { @@ -134,3 +139,34 @@ } } } + +.summary { + margin-bottom: 2px; + font-size: 0.875rem; + + .summary-label { + font-weight: bold; + } + + .summary-value { + + } + + .summary-edit { + color: $teal-400; + text-decoration: underline; + display: block; + margin-top: 5px; + &:after { + background-image: image-url("edit-with-pen.svg"); + content: " "; + display: inline-block; + width: 1em; + height: 1em; + margin-left: 5px; + line-height: 1em; + position: relative; + top: 2px; + } + } +} diff --git a/app/controllers/split_checkout_controller.rb b/app/controllers/split_checkout_controller.rb index 62e4a4d722..6a7435c8aa 100644 --- a/app/controllers/split_checkout_controller.rb +++ b/app/controllers/split_checkout_controller.rb @@ -32,6 +32,7 @@ class SplitCheckoutController < ::BaseController before_action :enable_embedded_shopfront helper 'spree/orders' + helper OrderHelper def edit return handle_redirect_from_stripe if valid_payment_intent_provided? diff --git a/app/views/split_checkout/_summary.html.haml b/app/views/split_checkout/_summary.html.haml new file mode 100644 index 0000000000..e22a27d720 --- /dev/null +++ b/app/views/split_checkout/_summary.html.haml @@ -0,0 +1,115 @@ +%div.checkout-substep + %div.checkout-title + = t("split_checkout.step3.your_details.title") + + %div.summary + %span.summary-label + = t("split_checkout.step1.your_details.first_name.label") + %span.summary-value + = @order.bill_address.firstname + + %div.summary + %span.summary-label + = t("split_checkout.step1.your_details.last_name.label") + %span.summary-value + = @order.bill_address.lastname + + %div.summary + %span.summary-label + = t("split_checkout.step1.your_details.email.label") + %span.summary-value + = @order.user.email + + %div.summary + %span.summary-label + = t("split_checkout.step1.your_details.phone.label") + %span.summary-value + = @order.bill_address.phone + +%div.checkout-substep + %div.checkout-title + = t("split_checkout.step3.billing_address.title") + + %div.summary + %span.summary-label + = t("split_checkout.step1.billing_address.address1.label") + %span.summary-value + = @order.bill_address.address1 + + - unless @order.bill_address.address2.blank? + %div.summary + %span.summary-label + = t("split_checkout.step1.billing_address.address2.label") + %span.summary-value + = @order.bill_address.address2 + + %div.summary + %span.summary-label + = t("split_checkout.step1.billing_address.city.label") + %span.summary-value + = @order.bill_address.city + + %div.summary + %span.summary-label + = t("split_checkout.step1.billing_address.state_id.label") + %span.summary-value + = @order.bill_address.state + + %div.summary + %span.summary-label + = t("split_checkout.step1.billing_address.zipcode.label") + %span.summary-value + = @order.bill_address.zipcode + + %div.summary + %span.summary-label + = t("split_checkout.step1.billing_address.country.label") + %span.summary-value + = @order.bill_address.country + +%div.checkout-substep + %div.checkout-title + = t("split_checkout.step3.delivery_info.title") + + %div.summary + %span.summary-label + = t("split_checkout.step1.delivery_address.title") + %span.summary-value + = @order.shipping_method.name + %div + = @order.shipping_method.description + + %a.summary-edit{href: main_app.checkout_step_path(:details)} + = t("split_checkout.step3.your_details.edit") + +%div.checkout-substep + %div.checkout-title + = t("split_checkout.step3.payment_method.title") + + %div.summary + %span.summary-value + = last_payment_method(@order)&.name + %p.text-small.text-skinny.pre-line + %em= last_payment_method(@order)&.description + %a.summary-edit{href: main_app.checkout_step_path(:payment)} + = t("split_checkout.step3.payment_method.edit") + + +%div.checkout-substep + %div.checkout-title + = t("split_checkout.step3.order.title") + + = render 'spree/orders/summary', order: @order + +%div.checkout-substep + %div.checkout-input + = f.check_box :accept_terms, {id: 'accept_terms', "checked": "#{all_terms_and_conditions_already_accepted?}"} + = f.label :accept_terms, t('split_checkout.step3.terms_and_conditions.message_html', terms_and_conditions_link: link_to( t("split_checkout.step3.terms_and_conditions.link_text"), @order.distributor.terms_and_conditions.url, target: '_blank'), tos_link: link_to_platform_terms), {for: "accept_terms"} + + %div.checkout-input + = t("split_checkout.step3.agree") + +%div.checkout-submit + = f.submit t("split_checkout.step3.submit"), class: "button primary", disabled: @terms_and_conditions_accepted == false || @platform_tos_accepted == false + %a.button.cancel{href: main_app.cart_path} + = t("split_checkout.step3.cancel") diff --git a/config/locales/en.yml b/config/locales/en.yml index fa393e57b6..f8f58c92da 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -1667,6 +1667,25 @@ en: explaination: You can review and confirm your order in the next step which includes the final costs. submit: Next - Order summary cancel: Back to Your details + step3: + your_details: + title: Your details + edit: Edit your details + billing_address: + title: Billing address + delivery_info: + title: Delivery info + payment_method: + title: Payment method + edit: Edit payment method + order: + title: Order total + terms_and_conditions: + message_html: "I agree to the seller's %{terms_and_conditions_link}." + link_text: "Terms and Conditions" + agree: By clickin 'Complete order' you agree to your order being processed. + submit: Complete order + cancel: Back to Payment method errors: required: Field cannot be blank invalid_number: "Please enter a valid phone number"