magento_api : Detailed module description

magento_api is intended to perform two-way connection of Drupal and Magento.
Also it synchronize Magento catalogue to Drupal taxonomy.

Installation of module

During installation the module creates the vocabulary of taxonomy terms in order to store Magento catalogue.
Additionally module creates the table magento_catalog, which is for storing the correspondences of Drupal taxonomy terms and Magento catalogue categories, in the Drupal database.

API methods

magento_api_settings()

Description: Login/password form for connection to Magento via XML-RPC.

magento_api_synchro_settings()

Description: Form for management of synchronization settings.
It allows to enable/disable the logging, set up the time of automatic synchronization and also to perform synchronization forcibly.

magento_api_cron_time_validate()

Description: Function checks the validity of timestamp entered to the form in magento_api_synchro_settings.
An error occurs if enter negative number of non-digit.

magento_api_customer_create($customerData)

Arguments: $customerData is data, required for customer creation
Return value: $new_customer is the ID of created customer
Description: Function makes a query about new customer creation to Magento and provides data required for.
If creation is successful, function returns the new customer ID.

magento_api_customer_info($customerId, $attributes)

Arguments: $customerId is the ID of customer
$attributes is attributes array for filtration
Return value: $customer is data array of found customer
Description: Functions makes a query about searching for customer information to Magento, optionally using customer ID and attributes.
If found, function returns the data array of customer.

magento_api_customer_update($customerId, $customerData)

Arguments: $customerId is the ID of customer
$customerData is data array for update
Return value: $updated is a sign of successful customer update
Description: Function makes a query about updating user information by customer ID to Magento.

magento_api_customer_delete($customerId)

Arguments: $customerId is the ID of customer
Return value: $deleted is a sign of successful customer delete
Description: Function makes a query about deleting customer by his/her ID to Magento.

magento_api_customer_group_list()

Return value: $result is groups of Magento users array
Description: Function makes a query about getting the list of all groups of customers to Magento.

magento_api_customer_get_customer_id_by_email($mail)

Arguments: $mail is an email address
Return value: $customer_id is the ID of customer
Description: Function makes a query about searching for customer by his/her email address to Magento.
If found, function returns the customer ID.

magento_api_sales_order_list($filters)

Arguments: $filters is parameters array for filtration
Return value: $order_list is orders array
Description: Function makes a query about searching for orders by specified parameters array to Magento.
Function returns found orders array.

magento_api_sales_order_info($orderId)

Arguments: $orderId is the ID of order
Return value: $order is order data array
Description: Function makes a query about issuing order data by its ID to Magento.

magento_api_catalog_rules_list()

Return value: $rules_list is rules array
Description: Function makes a query about issuing the list of all rules to Magento.
magento_api_catalog_product_list($filters, $storeView)
Arguments: $filters is parameters array for filtration
$storeView is the ID of StoreView
Return value: $product_list is products data array
Description: Function makes a query about issuing information on products to Magento.
Function returns found products array.

magento_api_catalog_product_list_simple($filters, $storeView)

Description: Function performs similar to magento_api_catalog_product_list actions, but returns the array of different structure.
magento_api_catalog_product_info($product, $storeView, $attributes)
Arguments: $product is the ID of product or its SKU
$storeView is the ID of StoreView
$attributes is parameters array for filtration
Return value: $product_info is products information array
Description: Function makes a query about issuing information on product by its ID and SKU to Magento.
If found, function returns product information array.

magento_api_directory_country_list()

Return value: $countries is available countries array
Description: Function makes a query about getting the list of available countries to Magento.

magento_api_directory_country_list_simple()

Description: Function performs similar to magento_api_directory_country_list actions, but returns the array of different structure.

magento_api_directory_region_list($country)

Arguments: $country is the ID of country
Return value: $regions is available regions array
Description: Function makes a query about getting the list of available regions of specified country.

magento_api_sales_order_shipment_list($filters)

Arguments: $filters is parameters array for filtration
Return value: $shipments is shipping&handling data array
Description: Function makes a query about getting shipping&handling information to Magento.

magento_api_sales_order_shipment_info($shipmentIncrementId)

Arguments: $shipmentIncrementId is the ID of shipping
Return value: $shipment is shipping data array
Description: Function makes a query about getting information of shipping by its ID to Magento.

magento_api_shipment_list()

Return value: $shipments is available shipping methods array
Description: Function makes a query about getting information of available shipping methods.

magento_api_shipment_list_simple()

Description: Function performs similar to magento_api_shipment_list actions, but returns the array of different structure.

magento_api_payment_list()

Return value: $payments is available payment methods array
Description: Function makes a query about getting information of available payment methods.

magento_api_order_create($orderData)

Arguments: $orderData is data array for order creation
Return value: $order is created order data array
Description: Function makes a query about creating new order by specified data to Magento.
If creation is successful, function returns all data of created order.

magento_api_quote_create($orderData)

Arguments: $orderData is data array for quote creation
Return value: $quote is created quote data array
Description: Function makes a query about creating new quote by specified data to Magento.
If creation is successful, function returns all data of created quote.

magento_api_payment_paypal_wps_account_info()

Return value: $acc is PayPal account name, specified in Magento settings
Description: Function requests the PayPal account name specified in store settings from Magento.
magento_api_sales_order_add_comment($orderIncrementId, $status, $comment, $notify)
Arguments: $orderIncrementId is the ID of order
$status is the status of order
$comment is the comments on order
$notify is notification flag
Description: Function makes a query about updating status of order and adding comment on it to Magento.

magento_api_sales_order_cancel($orderIncrementId)

Arguments: $orderIncrementId is the ID of order
Description: Function makes a query about cancelling order to Magento.

magento_api_config_info($path, $storeId)

Arguments: $path is the name of system variable
$storeId is the Store ID
Return value: $value is the value of system variable
Description: Function requests the value of system variable using its name from Magento.

magento_api_config_websites()

Return value: $value is websites data array
Description: Function makes a query about getting data of websites to Magento.

magento_api_config_stores()

Return value: $value is stores data array
Description: Function makes a query about getting data of stores to Magento.

magento_api_config_store_views()

Return value: $value is store views data array
Description: Function makes a query about getting data of store views to Magento.

magento_api_catalog_category_tree()

Return value: $value is categories data array
Description: Function requests the hierarchical tree of categories from Magento.

magento_api_catalog_product_attribute_list($setId)

Arguments: $setId is the ID of attributes set
Return value: $value is the list of attributes
Description: Function requests the list of attributes using the ID of attributes set from Magento.

magento_api_catalog_product_attribute_options($attributeId, $storeView)

Arguments: $attributeId is the ID of attribute
$storeView is the Store View ID
Return value: $value attribute data array
Description: Function makes a query about getting data of attribute by its ID to Magento.

magento_api_catalog_product_media_list($product, $storeView)

Arguments: $product is the ID of product or its SKU
$storeView is the Store View ID
Return value: $value is product images data array
Description: Function requests data of images of product using its ID or SKU from Magento.

magento_api_catalog_product_full_info($product, $storeView)

Arguments: $product is the ID of product or its SKU
$storeView is the Store View ID
Return value: $value is product data array
Description: Function requests complete data of product using its ID or SKU from Magento.

magento_api_catalog_product_actual_price($product, $qty, $groupId, $storeView)

Arguments: $product is the ID of product or its SKU
$qty is quantity of product
$groupId is the ID of user group
$storeView is the Store View ID
Return value: $value is an actual price of product
Description: Function request an actual price of product considering all taxes, discounts and actions from Magento.

magento_api_magento_event($event, $categoryId)

Arguments: $event is an event
$categoryId is the ID of category which was event-occured
Description: Hook, by which updating of Drupal taxonomy for replication of changes in structure of Magento catalogue is performed.

magento_api_cron()

Description: Hook, by which and upon cron execution automatic synchronization with Magento is performed.
Synchronization of catalogue, products, rules and stores is performed regarding to time intervals, specified at page.