-
-
Notifications
You must be signed in to change notification settings - Fork 725
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8438 from cillian/show-out-of-stock-line-items
If an order has out of stock line items display them and let admins remove them
- Loading branch information
Showing
5 changed files
with
139 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,9 @@ | |
- if @line_item.try(:errors).present? | ||
= render :partial => 'spree/shared/error_messages', :locals => { :target => @line_item } | ||
- if [email protected]? && @order.insufficient_stock_lines.any? | ||
= render 'spree/admin/orders/insufficient_stock_lines', insufficient_stock_lines: @order.insufficient_stock_lines | ||
= render :partial => "spree/admin/orders/shipment", :collection => @order.shipments, :locals => { :order => order } | ||
= render :partial => "spree/admin/orders/_form/adjustments", :locals => { :adjustments => @order.line_item_adjustments, :title => t(".line_item_adjustments")} | ||
|
39 changes: 39 additions & 0 deletions
39
app/views/spree/admin/orders/_insufficient_stock_lines.html.haml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
%div.insufficient-stock-items | ||
%fieldset.no-border-bottom | ||
%legend | ||
= t("spree.orders.line_item.out_of_stock") | ||
|
||
%table | ||
%colgroup | ||
%col{ :style => "width: 10%;" } | ||
%col{ :style => "width: 30%;" } | ||
%col{ :style => "width: 15%;" } | ||
%col{ :style => "width: 15%;" } | ||
%col{ :style => "width: 15%;" } | ||
%col{ :style => "width: 15%;" } | ||
|
||
%thead | ||
%th{ :colspan => "2" } | ||
= Spree.t(:item_description) | ||
%th | ||
= Spree.t(:price) | ||
%th | ||
= Spree.t(:quantity) | ||
%th | ||
= Spree.t(:total) | ||
%th.orders-actions.actions | ||
|
||
- insufficient_stock_lines.each do |line_item| | ||
%tr.insufficient-stock-item | ||
%td | ||
= render 'spree/shared/variant_thumbnail', variant: line_item.variant | ||
%td | ||
= line_item.variant.product_and_full_name | ||
%td.align-center | ||
= line_item.single_money.to_html | ||
%td.align-center | ||
= line_item.quantity | ||
%td.align-center | ||
= line_item.money.to_html | ||
%td.actions | ||
= link_to_delete line_item, { url: main_app.admin_bulk_line_item_path(line_item), no_text: true } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters