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.

fix: line item partial UI issues (#12610)

Caio Câmaraf7d3ce9e71b9
diff --git a/storefront/app/views/spree/checkout/_line_item.html.erb b/storefront/app/views/spree/checkout/_line_item.html.erb
index 78c2a7e16f..d660807c24 100644
--- a/storefront/app/views/spree/checkout/_line_item.html.erb
+++ b/storefront/app/views/spree/checkout/_line_item.html.erb
@@ -1,20 +1,18 @@
-<div class="flex justify-between items-center">
- <div class="flex items-center">
- <div class="mr-5 w-[64px] h-[64px] relative rounded bg-accent-100">
- <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">
- <%= line_item.quantity %>
- </span>
- <% image = line_item.variant.default_image %>
- <% if image.present? && image.attached? && image.variable? %>
- <%= image_tag main_app.cdn_image_url(image.variant(spree_image_variant_options(resize_to_fill: [128, 128]))), class: 'rounded border border-default bg-transparent object-cover object-center', loading: :lazy, width: 64, height: 64 %>
- <% end %>
- </div>
- <div class="col-6 col-md-8 pr-3 text-sm">
- <p class="font-bold word-break"><%= line_item.name %></p>
- <p class="text-xs"><%= line_item.options_text %></p>
- </div>
+<div class="flex justify-between items-center pt-3">
+ <div class="mr-5 w-[60px] h-[60px] relative rounded bg-accent-100 shrink-0">
+ <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">
+ <%= line_item.quantity %>
+ </span>
+ <% image = line_item.variant.default_image %>
+ <% if image.present? && image.attached? && image.variable? %>
+ <%= image_tag main_app.cdn_image_url(image.variant(spree_image_variant_options(resize_to_fill: [128, 128]))), class: 'rounded border border-default bg-transparent object-cover object-center', loading: :lazy, width: 60, height: 60 %>
+ <% end %>
+ </div>
+ <div class="flex-1 pr-3 text-sm">
+ <p class="font-bold word-break"><%= line_item.name %></p>
+ <p class="text-xs"><%= line_item.options_text %></p>
</div>
- <div class="font-semibold text-sm text-right">
+ <div class="font-semibold text-sm text-right shrink-0">
<% if should_display_compare_at_price?(line_item.variant) %>
<span class="line-through text-red-500">
<%= Spree::Money.new(line_item.variant.compare_at_amount_in(line_item.currency) * line_item.quantity, currency: line_item.currency) %>