Skip to content

armgit / spree

Public Imported from GitHub
0

Open Source Platform for DTC, B2B Commerce, Marketplaces & Omnichannel. REST APIs, TypeScript SDKs, and production-ready Next.js storefront. Self-host it. Own your data. No vendor lock-in. Zero platform fees.

Fixed compatibility of order_details partial for extensions (#10707)

Damian Legawiece9bf801c6a3f
diff --git a/frontend/app/assets/stylesheets/spree/frontend/views/spree/checkout/confirm.scss b/frontend/app/assets/stylesheets/spree/frontend/views/spree/checkout/confirm.scss
index d26bddd936..0ce2f0e377 100644
--- a/frontend/app/assets/stylesheets/spree/frontend/views/spree/checkout/confirm.scss
+++ b/frontend/app/assets/stylesheets/spree/frontend/views/spree/checkout/confirm.scss
@@ -47,15 +47,6 @@
&-line-item {
$self: &;
- a {
- max-width: 50%;
- margin-right: 20px;
-
- @include media-breakpoint-up(lg) {
- margin-right: 40px;
- }
- }
-
img {
width: 90px;
height: auto;
@@ -72,14 +63,24 @@
&-name {
font-size: font-px-to-rem(14px);
border-top: 1px solid $global-border-style;
+ margin-right: 20px;
- @include media-breakpoint-up(sm) {
- font-size: font-px-to-rem(27px);
- }
+ &-link {
+ max-width: 50%;
- @include media-breakpoint-up(lg) {
- font-size: font-px-to-rem(22px);
- width: 55%;
+ @include media-breakpoint-up(lg) {
+ margin-right: 40px;
+ }
+
+
+ @include media-breakpoint-up(sm) {
+ font-size: font-px-to-rem(27px);
+ }
+
+ @include media-breakpoint-up(lg) {
+ font-size: font-px-to-rem(22px);
+ width: 55%;
+ }
}
&-options {
diff --git a/frontend/app/views/spree/shared/_order_details.html.erb b/frontend/app/views/spree/shared/_order_details.html.erb
index 76faf56921..b69f193586 100644
--- a/frontend/app/views/spree/shared/_order_details.html.erb
+++ b/frontend/app/views/spree/shared/_order_details.html.erb
@@ -70,18 +70,20 @@
<%= Spree.t(:total) %>
</p>
</div>
- <% @order.line_items.each do |line_item| %>
+ <% @order.line_items.each do |item| %>
<div class="checkout-confirm-order-details-line-items-line-item w-100 d-table-row" data-hook="order_details_line_item_row">
<div class="checkout-confirm-order-details-line-items-line-item-name d-table-cell align-middle py-3 py-sm-4">
<div class="d-flex align-items-lg-center">
<div data-hook="order_item_image">
- <%= link_to product_image(line_item.variant), line_item.product %>
+ <%= link_to product_image(item.variant), item.product %>
</div>
<div class="d-flex flex-column mt-2 mt-lg-0" data-hook="order_item_description">
- <div><%= link_to line_item.name, line_item.product %></div>
- <% unless line_item.variant.is_master? %>
+ <div data-hook="order_item_name">
+ <%= link_to item.name, item.product, class: 'checkout-confirm-order-details-line-items-line-item-name-link' %>
+ </div>
+ <% unless item.variant.is_master? %>
<ul class="checkout-confirm-order-details-line-items-line-item-name-options text-uppercase list-unstyled mb-0">
- <% line_item.variant.option_values.sort { |ov| ov.option_type.position }.each do |ov| %>
+ <% item.variant.option_values.sort { |ov| ov.option_type.position }.each do |ov| %>
<li>
<% # TODO: rework option values so options_text method can be used here %>
<%= "#{ov.option_type.presentation}: #{ov.name.titleize}" %>
@@ -90,23 +92,23 @@
</ul>
<% end %>
<div class="d-lg-none" data-hook="order_item_price">
- <div class="font-weight-bold"><%= line_item.single_money.to_html %></div>
+ <div class="font-weight-bold"><%= item.single_money.to_html %></div>
</div>
<div class="d-lg-none" data-hook="order_item_qty">
<span><%= Spree.t(:quantity) %>:</span>
- <span class="font-weight-bold"><%= line_item.quantity %></span>
+ <span class="font-weight-bold"><%= item.quantity %></span>
</div>
</div>
</div>
</div>
<div class="checkout-confirm-order-details-line-items-line-item-price d-none d-lg-table-cell align-middle py-4" data-hook="order_item_price">
- <div><%= line_item.single_money.to_html %></div>
+ <div><%= item.single_money.to_html %></div>
</div>
<div class="checkout-confirm-order-details-line-items-line-item-quantity d-none d-lg-table-cell align-middle py-4" data-hook="order_item_qty">
- <span class="checkout-confirm-order-details-line-items-line-item-quantity-val d-lg-block"><%= line_item.quantity %></span>
+ <span class="checkout-confirm-order-details-line-items-line-item-quantity-val d-lg-block"><%= item.quantity %></span>
</div>
<div class="checkout-confirm-order-details-line-items-line-item-total d-none d-lg-table-cell align-middle py-4" data-hook="order_item_total">
- <div><%= line_item.display_total.to_s %></div>
+ <div><%= item.display_total.to_s %></div>
</div>
</div>
<% end %>