<commit_before>module Spree
  Variant.class_eval do

    attr_accessible :use_master_price
   
    #return product master price if use_master_price flag is set to true 
    def price
      return product.master.price if use_master_price? && !is_master?

      default_price.price
    end

    def money
      
      if use_master_price? && !is_master?
        Spree::Money.new(default_price.price || 0, { currency: currency })
      else
        Spree::Money.new(amount || 0, { currency: currency })
      end
    end

  end
end<commit_msg>use default price method<commit_after>module Spree
  Variant.class_eval do

    attr_accessible :use_master_price
   
    #return product master price if use_master_price flag is set to true 
    def price
      return product.master.price if use_master_price? && !is_master?

      default_price.price
    end

    def display_price
      if use_master_price? && !is_master?
        Spree::Money.new(product.master.price.amount || 0, { currency: currency })
      else
        Spree::Money.new(default_price.amount || 0, { currency: currency })
      end
    end

  end
end
{'fraction_non_alphanumeric': 0.07809694793536805, 'fraction_numerical': 0.003590664272890485, 'mean_word_length': 2.766891891891892, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3730726', 'n_tokens_mistral': 352, 'n_tokens_neox': 329, 'n_words': 90}