spree-product-assembly
spree-product-assembly copied to clipboard
Shipping methods determination ignore shipping category of assembly
Package#shipping_methods https://github.com/spree/spree/blob/3-0-stable/core/app/models/spree/stock/package.rb#L68 is based on parts shipping categories, but store owner can set separate shipping category for assembly itself.
I propose to override https://github.com/spree/spree/blob/3-0-stable/core/app/models/spree/stock/package.rb#L64..L66 with:
module Spree
module Stock
Package.class_eval do
def shipping_categories
contents.map { |item| item.line_item.variant.shipping_category }.compact.uniq
end
end
end
end
What do you think about it?
looks good to me