From 7d5bb4a6fa449152e7c2a2427bc8fa4c8cdfa41a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20Gon=C3=A7alves?= Date: Sun, 1 Dec 2024 15:13:49 +0000 Subject: [PATCH] Added the :selected option with the default tax category --- app/views/spree/admin/products/_tax_category_form.html.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/spree/admin/products/_tax_category_form.html.haml b/app/views/spree/admin/products/_tax_category_form.html.haml index 5c8080ca3b..aa919ae4f1 100644 --- a/app/views/spree/admin/products/_tax_category_form.html.haml +++ b/app/views/spree/admin/products/_tax_category_form.html.haml @@ -1,5 +1,5 @@ = f.field_container :tax_category_id do = f.label :tax_category_id, t(:tax_category) %br - = f.collection_select(:tax_category_id, Spree::TaxCategory.all, :id, :name, {:include_blank => Spree::Config.products_require_tax_category ? false : t(:none)}, {:class => "select2 fullwidth"}) + = f.collection_select(:tax_category_id, Spree::TaxCategory.all, :id, :name, {:include_blank => Spree::Config.products_require_tax_category ? false : t(:none), selected: Spree::TaxCategory.find_by(is_default: true)&.id}, {:class => "select2 fullwidth"}) = f.error_message_on :tax_category_id