mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
Update shipping_category usage in admin pages
This commit is contained in:
@@ -27,7 +27,7 @@ module Spree
|
||||
end
|
||||
|
||||
def new
|
||||
@object.shipping_category = DefaultShippingCategory.find_or_create
|
||||
@object.shipping_category_id = DefaultShippingCategory.find_or_create.id
|
||||
end
|
||||
|
||||
def edit
|
||||
|
||||
@@ -19,6 +19,7 @@ module Spree
|
||||
|
||||
def edit
|
||||
@url_filters = ::ProductFilters.new.extract(request.query_parameters)
|
||||
@object.shipping_category = DefaultShippingCategory.find_or_create
|
||||
end
|
||||
|
||||
def create
|
||||
@@ -114,6 +115,7 @@ module Spree
|
||||
|
||||
def load_data
|
||||
@tax_categories = TaxCategory.order(:name)
|
||||
@shipping_categories = ShippingCategory.order(:name)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -38,11 +38,6 @@
|
||||
|
||||
.clear
|
||||
|
||||
= f.field_container :shipping_categories do
|
||||
= f.label :shipping_category_id, t(:shipping_categories)
|
||||
= f.collection_select(:shipping_category_id, @shipping_categories, :id, :name, {}, { :class => 'select2' })
|
||||
= f.error_message_on :shipping_category
|
||||
|
||||
.clear
|
||||
|
||||
%div
|
||||
|
||||
@@ -68,4 +68,8 @@
|
||||
= f.label :tax_category_id, t(:tax_category)
|
||||
= f.collection_select(:tax_category_id, @tax_categories, :id, :name, { include_blank: t(:none) }, { class: 'select2 fullwidth' })
|
||||
|
||||
.field
|
||||
= f.label :shipping_category_id, t(:shipping_categories)
|
||||
= f.collection_select(:shipping_category_id, @shipping_categories, :id, :name, {}, { class: 'select2 fullwidth' })
|
||||
|
||||
.clear
|
||||
|
||||
Reference in New Issue
Block a user