Sha256: 0e870469de694b9c625258d2684a2e259a0777c0d48efb7596ed133b992c2614

Contents?: true

Size: 548 Bytes

Versions: 2

Compression:

Stored size: 548 Bytes

Contents

class Plugins::Ecommerce::OrderService
  def initialize(site, order)
    @site = site
    @order = order
  end
  
  attr_reader :site, :order
  
  def product_owners
    owners = []
    order.products.each do |product|
      owners << product.owner if product.owner.present?
    end
    owners.uniq
  end
  
  def product_files
    files = []
    order.products.each do |product|
      files += product.get_fields('ecommerce_files').map do |f|
        CamaleonCmsLocalUploader::private_file_path(f, site)
      end
    end
    files.uniq
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
camaleon_ecommerce-1.2.1 app/services/plugins/ecommerce/order_service.rb
camaleon_ecommerce-1.2 app/services/plugins/ecommerce/order_service.rb