From 032c06bc35e4f9b140eb785427bc32d152940b94 Mon Sep 17 00:00:00 2001 From: Nick Van Doorn Date: Wed, 23 Oct 2024 13:38:42 -0700 Subject: [PATCH] Render variant shipping category If a variant does not have a shipping category defined, the form will render with the shipping category from the associated product. If you submit the form, the variant will now have the same shipping category as associated the product. We fix this by always rendering the form with the shipping category associated with the variant. Co-authored-by: An Stewart --- backend/app/views/spree/admin/variants/_form.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/app/views/spree/admin/variants/_form.html.erb b/backend/app/views/spree/admin/variants/_form.html.erb index b7cfd91e74e..9a12b8c3b29 100644 --- a/backend/app/views/spree/admin/variants/_form.html.erb +++ b/backend/app/views/spree/admin/variants/_form.html.erb @@ -103,7 +103,7 @@ @shipping_categories, :id, :name, - { include_blank: t('.use_product_shipping_category') }, + { include_blank: t('.use_product_shipping_category'), selected: @variant[:shipping_category_id] }, { class: 'custom-select fullwidth' } %>