diff --git a/admin/app/controllers/solidus_admin/products_controller.rb b/admin/app/controllers/solidus_admin/products_controller.rb index a085ef0d41c..094c2c6ab08 100644 --- a/admin/app/controllers/solidus_admin/products_controller.rb +++ b/admin/app/controllers/solidus_admin/products_controller.rb @@ -11,6 +11,8 @@ class ProductsController < SolidusAdmin::BaseController search_scope(:in_stock) { _1.where(id: Spree::Variant.in_stock.distinct.select(:product_id)) } search_scope(:out_of_stock) { _1.where.not(id: Spree::Variant.in_stock.distinct.select(:product_id)) } + before_action :split_params, only: [:update] + def index products = apply_search_to( Spree::Product.includes(:master, :variants), @@ -98,5 +100,14 @@ def activate flash[:notice] = t('.success') redirect_to products_path, status: :see_other end + + def split_params + if params[:product][:taxon_ids].present? + params[:product][:taxon_ids] = params[:product][:taxon_ids].split(',') + end + if params[:product][:option_type_ids].present? + params[:product][:option_type_ids] = params[:product][:option_type_ids].split(',') + end + end end end