Requirement is for a custom magento script, which accepts an http post operation
with the following fields, and creates an order & customer in the magento database.
name Customer name
address_line1 Billing address line 1
address_line2, Billing address line 2
city, Billing city
zip, Billing zip/postcode
state, Billing state
country, Billing country
phone, Customer phone
email, Customer email
delivery_name, Shipping name
delivery_address_line1, Shipping address line 1
delivery_address_lne2, Shipping address line 2
delivery_city, Shipping city
delivery_zip, Shipping zip
delivery_state, Shipping state
payment_method, Payment method (e.g. "PayPal")
currency, Currency code - e.g. USD
num_different_products, The number of different products in the order
product_id_1, Product ID of first product
product_name_1, Name of first product
quantity_1, Quantity of first product bought
price_1 Price of first product
attribute_name_1_1, Name of first attribute of first product (e.g. Size)
attribute_value_1_1, Value of first attribute (e.g. Large)
attribute_name_1_2, Name of second attribute of first product (e.g. Color)
attribute_value_1_2, Value of second attribute (e.g. Blue)
product_id_2, Product ID of second product
product_name_2, Name of second product
quantity_2, Quantity of second product bought
price_2 Price of second product
attribute_name_2_1, Name of first attribute of second product
attribute_value_2_1, Value of first attribute of second product
shipping, Total shipping costs for entire order
tax, Total tax rate for entire order (5 means 5% tax)
total, Total cost of order
The module will then:
1. Check if the customer already exists in the magento database.
2. If the customer does not exist, create the customer and print out the
password followed by a new line.
3. Add the order to the database.
4. Print out the newly created order id.
5. Decrement the stock for the relevant products.