Sha256: e0bc232333638fe9bdd068b8a5d290a1f3e7d9f5b6a70d324f4839bd005d80fa

Contents?: true

Size: 545 Bytes

Versions: 1

Compression:

Stored size: 545 Bytes

Contents

module Magento
  class OrderItem < Base
    class << self      
      def find_by_id(id)
        Order.list.each do |order|
          Order.info(order.id).order_items.select{ |i| i.id == id }
        end
      end
      
      def find_by_order_and_id(order_id, id)
        Order.find_by_id(order_id).order_items.select{ |i| i.id == id }
      end
    end
    
    def id
      self.item_id
    end
    
    def order
      Order.info(self.order_id)
    end
    
    def product
      Product.find_by_id_or_sku(self.product_id)
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
magentor-0.1.10 lib/magento/order_item.rb