Skip to content

Commit

Permalink
Render variant shipping category
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
nvandoorn and stewart committed Oct 23, 2024
1 parent e509aa9 commit 74c1a5d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion backend/app/views/spree/admin/variants/_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -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' } %>
</div>
</div>
Expand Down

0 comments on commit 74c1a5d

Please sign in to comment.