module PIM::Shoppingcart

Constants

SHOPPINGCART_ATTRIBUTES

Public Class Methods

shoppingcart_item(&block) click to toggle source
# File shoppingcart.rb, line 9
def self.shoppingcart_item &block

  primary_key = $primary_key
  quantity = $quantity

  item = load_item_as_ruby(primary_key)
  return nil if !item

  cart_item = {}
  SHOPPINGCART_ATTRIBUTES.each { |a| cart_item[a] = nil }
  cart_item[:primary_key] = primary_key
  cart_item[:quantity] = quantity

  block.call item, quantity, cart_item

  PIM.print_json(PIM.camelize(cart_item))

end