From a84f9ebd2ed98268e386da0d1d72db8362b736f2 Mon Sep 17 00:00:00 2001 From: Matt-Yorkley <9029026+Matt-Yorkley@users.noreply.github.com> Date: Mon, 3 Jul 2023 16:24:01 +0100 Subject: [PATCH] Allow passing tax_category to new variant when creating a new product --- app/models/spree/product.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/models/spree/product.rb b/app/models/spree/product.rb index 9a1cfd27ba..472c3d9813 100755 --- a/app/models/spree/product.rb +++ b/app/models/spree/product.rb @@ -76,7 +76,7 @@ module Spree # Transient attributes used temporarily when creating a new product, # these values are persisted on the product's variant - attr_accessor :price, :display_as, :unit_value, :unit_description + attr_accessor :price, :display_as, :unit_value, :unit_description, :tax_category_id before_save :add_primary_taxon_to_taxons @@ -309,6 +309,7 @@ module Spree variant.display_as = display_as variant.unit_value = unit_value variant.unit_description = unit_description + variant.tax_category_id = tax_category_id variants << variant end