core/app/models/spree/variant.rb
def check_price
      if price.nil? && Spree::Config[:require_master_price]
        return errors.add(:base, :no_master_variant_found_to_infer_price)  unless product && product.master
        return errors.add(:base, :must_supply_price_for_variant_or_master) if self == product.master
        self.price = product.master.price
      end
      if price.present? && currency.nil?
        self.currency = Spree::Config[:currency]
      end
    end
# Ensures a new variant takes the product master price when price is not supplied
Ensures a new variant takes the product master price when price is not supplied
Ensures a new variant takes the product master price when price is not supplied
def check_price
      if price.nil? && Spree::Config[:require_master_price]
        return errors.add(:base, :no_master_variant_found_to_infer_price)  unless product && product.master
        return errors.add(:base, :must_supply_price_for_variant_or_master) if self == product.master
        self.price = product.master.price
      end
      if price.present? && currency.nil?
        self.currency = Spree::Config[:currency]
      end
    end
def check_price if price . nil? && Spree :: Config [ :require_master_price ] return errors . add ( :base , :no_master_variant_found_to_infer_price ) unless product && product . master return errors . add ( :base , :must_supply_price_for_variant_or_master ) if self == product . master self . price = product . master . price end if price . present? && currency . nil? self . currency = Spree :: Config [ :currency ] end end
Ensures a new variant takes the product master price when price is not supplied
Ensures a new variant takes the product master price when price is not supplied