Sha256: 17fc5f12785f19638369eae104d2f9050d78aee006bf05aef079e874fa660488
Contents?: true
Size: 641 Bytes
Versions: 6
Compression:
Stored size: 641 Bytes
Contents
module Magento class OrderItem < Base class << self def find_by_id(id) Order.list.each do |order| item = Order.find_by_increment_id(order.increment_id).order_items.select{ |i| i.id == id } return item.first if item and item.first end end def find_by_order_and_id(order_id, id) Order.find_by_id(order_id).order_items.select{ |i| i.id == id }.first end end def id self.item_id end def order Order.find_by_id(self.order_id) end def product Product.find_by_id_or_sku(self.product_id) end end end
Version data entries
6 entries across 6 versions & 1 rubygems