diff --git a/admin/app/components/solidus_admin/orders/cart/component.html.erb b/admin/app/components/solidus_admin/orders/cart/component.html.erb new file mode 100644 index 00000000000..8e43c49f31e --- /dev/null +++ b/admin/app/components/solidus_admin/orders/cart/component.html.erb @@ -0,0 +1,115 @@ +
Product | +Quantity | +Price | +Actions | +
---|---|---|---|
+
+ <% variant = line_item.variant %>
+ <%= render component("ui/thumbnail").new(
+ src: (variant.images.first || variant.product.gallery.images.first)&.url(:small),
+ alt: variant.name
+ ) %>
+
+
+
+ <%= variant.name %>
+
+ SKU: <%= variant.sku %>
+ <%= variant.options_text.presence&.prepend("- ") %>
+
+ |
+ + <%= form_for(line_item, url: solidus_admin.order_line_item_path(@order, line_item), html: { + "data-controller": "readonly-when-submitting" + }) do |f| %> + <%= render component("ui/forms/input").new( + name: "#{f.object_name}[quantity]", + type: :number, + value: line_item.quantity, + "aria-label": "Quantity", + min: 0, + class: "!w-16 inline-block", + "data-action": "input->#{stimulus_id}#updateLineItem", + ) %> + <% render component("ui/button").new(type: :submit, text: "Update", class: "inline-block") %> + <% end %> + | ++ <%= line_item.single_money.to_html %> + | ++ <%= form_for(line_item, url: solidus_admin.order_line_item_path(@order, line_item), method: :delete) do |f| %> + <%= render component('ui/button').new( + scheme: :ghost, + size: :s, + title: t("spree.delete"), + icon: 'close-line', + "data-controller": "confirm", + "data-confirm-text-value": t("spree.are_you_sure"), + ) %> + <% end %> + | +