timmatheson / Magento

Ruby wrapper around the Magento Cart Api

This URL has Read+Write access

Tim Matheson (author)
Thu Oct 15 11:33:56 -0700 2009
commit  196931e43e8a31a4b8585dcb3a132284cd86f3a8
tree    1ccf5d687f7a606387c2a2fc780c052e07d1d6e7
parent  2e84f712ff992ef0a69c0869d46fe4d7c31df671
README.rdoc

Magento ===================

This is a simple gem which wraps Magento XMLRPC calls with Ruby classes. This allows for you to integrate your Magento Shopping Cart into your Rails Application. This is not fully tested and some functionality is a WIP.

The full Magento Core Api is available at www.magentocommerce.com/support/magento_core_api

The current supported resources are:

  Category
  Country
  Customer
  CustomerAddress
  CustomerGroups
  Inventory
  Invoice
  Order
  Product
  ProductImages
  ProductTypes
  Region
  Shipment

Usage =====================

Edit config/config.yml and add your magento api username and api key to the file.

Get a single customer with an ID of 1

  customer = Magento::Customer.find("1")

  # all attributes are available now as array indexes

  customer['firstname'] => "Tim"
  customer['lastname'] => "Matheson"

  # and so on

Issues ====================

A patch needs to be applied to XMLRPC for this to work. Without the patch you will most likely get this error. "wrong/unknown XML-RPC type ‘nil’"

Locate the xmlrpc gem on your system.

Edit the config.rb file, find it in your system, locate the gem directory.

Around line 23

change to this

  ENABLE_NIL_PARSER    = false

to this

  ENABLE_NIL_PARSER    = true

This will prevent the parser from raising exceptions when nil nodes are returned.