Class: SolidusImporter::Processors::Product

Inherits:
Base
  • Object
show all
Defined in:
lib/solidus_importer/processors/product.rb

Instance Method Summary collapse

Instance Method Details

#call(context) ⇒ Object



6
7
8
9
10
# File 'lib/solidus_importer/processors/product.rb', line 6

def call(context)
  @data = context.fetch(:data)
  check_data
  context.merge!(product: process_product)
end

#optionsObject



12
13
14
15
16
17
18
19
# File 'lib/solidus_importer/processors/product.rb', line 12

def options
  @options ||= {
    available_on: Date.current.yesterday,
    not_available: nil,
    price: 0,
    shipping_category: Spree::ShippingCategory.find_by(name: 'Default') || Spree::ShippingCategory.first
  }
end