Overview

Namespaces

  • None
  • PHP

Classes

  • Mailchimp
  • Mailchimp_Campaigns
  • Mailchimp_Ecomm
  • Mailchimp_Folders
  • Mailchimp_Gallery
  • Mailchimp_Helper
  • Mailchimp_Lists
  • Mailchimp_Mobile
  • Mailchimp_Neapolitan
  • Mailchimp_Reports
  • Mailchimp_Templates
  • Mailchimp_Users
  • Mailchimp_Vip

Exceptions

  • Mailchimp_Absplit_UnknownError
  • Mailchimp_Absplit_UnknownSplitTest
  • Mailchimp_Absplit_UnknownTestType
  • Mailchimp_Absplit_UnknownWaitUnit
  • Mailchimp_Absplit_UnknownWinnerType
  • Mailchimp_Absplit_WinnerNotSelected
  • Mailchimp_Avesta_Db_Exception
  • Mailchimp_Campaign_BounceMissing
  • Mailchimp_Campaign_DoesNotExist
  • Mailchimp_Campaign_InvalidAbsplit
  • Mailchimp_Campaign_InvalidAuto
  • Mailchimp_Campaign_InvalidContent
  • Mailchimp_Campaign_InvalidOption
  • Mailchimp_Campaign_InvalidRss
  • Mailchimp_Campaign_InvalidSegment
  • Mailchimp_Campaign_InvalidStatus
  • Mailchimp_Campaign_InvalidTemplate
  • Mailchimp_Campaign_NotSaved
  • Mailchimp_Campaign_StatsNotAvailable
  • Mailchimp_Email_AlreadySubscribed
  • Mailchimp_Email_AlreadyUnsubscribed
  • Mailchimp_Email_NotExists
  • Mailchimp_Email_NotSubscribed
  • Mailchimp_Error
  • Mailchimp_HttpError
  • Mailchimp_Invalid_Analytics
  • Mailchimp_Invalid_ApiKey
  • Mailchimp_Invalid_AppKey
  • Mailchimp_Invalid_DateTime
  • Mailchimp_Invalid_EcommOrder
  • Mailchimp_Invalid_Email
  • Mailchimp_Invalid_Folder
  • Mailchimp_Invalid_IP
  • Mailchimp_Invalid_Options
  • Mailchimp_Invalid_PagingLimit
  • Mailchimp_Invalid_PagingStart
  • Mailchimp_Invalid_SendType
  • Mailchimp_Invalid_Template
  • Mailchimp_Invalid_TrackingOptions
  • Mailchimp_Invalid_URL
  • Mailchimp_List_AlreadySubscribed
  • Mailchimp_List_CannotRemoveEmailMerge
  • Mailchimp_List_DoesNotExist
  • Mailchimp_List_InvalidBounceMember
  • Mailchimp_List_InvalidImport
  • Mailchimp_List_InvalidInterestFieldType
  • Mailchimp_List_InvalidInterestGroup
  • Mailchimp_List_InvalidMergeField
  • Mailchimp_List_InvalidOption
  • Mailchimp_List_InvalidUnsubMember
  • Mailchimp_List_Merge_InvalidMergeID
  • Mailchimp_List_MergeFieldRequired
  • Mailchimp_List_NotSubscribed
  • Mailchimp_List_TooManyInterestGroups
  • Mailchimp_List_TooManyMergeFields
  • Mailchimp_Max_Size_Reached
  • Mailchimp_MC_ContentImport_InvalidArchive
  • Mailchimp_MC_InvalidPayment
  • Mailchimp_MC_PastedList_Duplicate
  • Mailchimp_MC_PastedList_InvalidImport
  • Mailchimp_MC_SearchException
  • Mailchimp_Module_Unknown
  • Mailchimp_MonthlyPlan_Unknown
  • Mailchimp_Order_TypeUnknown
  • Mailchimp_Parse_Exception
  • Mailchimp_PDOException
  • Mailchimp_Request_TimedOut
  • Mailchimp_ServerError_InvalidParameters
  • Mailchimp_ServerError_MethodUnknown
  • Mailchimp_Too_Many_Connections
  • Mailchimp_Unknown_Exception
  • Mailchimp_User_CannotSendCampaign
  • Mailchimp_User_Disabled
  • Mailchimp_User_DoesExist
  • Mailchimp_User_DoesNotExist
  • Mailchimp_User_InvalidAction
  • Mailchimp_User_InvalidRole
  • Mailchimp_User_MissingEmail
  • Mailchimp_User_MissingModuleOutbox
  • Mailchimp_User_ModuleAlreadyPurchased
  • Mailchimp_User_ModuleNotPurchased
  • Mailchimp_User_NotApproved
  • Mailchimp_User_NotEnoughCredit
  • Mailchimp_User_UnderMaintenance
  • Mailchimp_User_Unknown
  • Mailchimp_ValidationError
  • Mailchimp_XML_RPC2_Exception
  • Mailchimp_XML_RPC2_FaultException
  • Mailchimp_Zend_Uri_Exception
  • Overview
  • Namespace
  • Class
  • Tree
 1: <?php
 2: 
 3: class Mailchimp_Ecomm {
 4:     public function __construct(Mailchimp $master) {
 5:         $this->master = $master;
 6:     }
 7: 
 8:     /**
 9:      * Import Ecommerce Order Information to be used for Segmentation. This will generally be used by ecommerce package plugins
10: <a href="http://connect.mailchimp.com/category/ecommerce" target="_blank">provided by us or by 3rd part system developers</a>.
11:      * @param associative_array $order
12:      *     - id string the Order Id
13:      *     - campaign_id string optional the Campaign Id to track this order against (see the "mc_cid" query string variable a campaign passes)
14:      *     - email_id string optional (kind of) the Email Id of the subscriber we should attach this order to (see the "mc_eid" query string variable a campaign passes) - required if campaign_id is passed, otherwise either this or <strong>email</strong> is required. If both are provided, email_id takes precedence
15:      *     - email string optional (kind of) the Email Address we should attach this order to - either this or <strong>email_id</strong> is required. If both are provided, email_id takes precedence
16:      *     - total double The Order Total (ie, the full amount the customer ends up paying)
17:      *     - order_date string optional the date of the order - if this is not provided, we will default the date to now. Should be in the format of 2012-12-30
18:      *     - shipping double optional the total paid for Shipping Fees
19:      *     - tax double optional the total tax paid
20:      *     - store_id string a unique id for the store sending the order in (32 bytes max)
21:      *     - store_name string optional a "nice" name for the store - typically the base web address (ie, "store.mailchimp.com"). We will automatically update this if it changes (based on store_id)
22:      *     - items array structs for each individual line item including:
23:      *         - line_num int optional the line number of the item on the order. We will generate these if they are not passed
24:      *         - product_id int the store's internal Id for the product. Lines that do no contain this will be skipped
25:      *         - sku string optional the store's internal SKU for the product. (max 30 bytes)
26:      *         - product_name string the product name for the product_id associated with this item. We will auto update these as they change (based on product_id)
27:      *         - category_id int the store's internal Id for the (main) category associated with this product. Our testing has found this to be a "best guess" scenario
28:      *         - category_name string the category name for the category_id this product is in. Our testing has found this to be a "best guess" scenario. Our plugins walk the category heirarchy up and send "Root - SubCat1 - SubCat4", etc.
29:      *         - qty double optional the quantity of the item ordered - defaults to 1
30:      *         - cost double optional the cost of a single item (ie, not the extended cost of the line) - defaults to 0
31:      * @return associative_array with a single entry:
32:      *     - complete bool whether the call worked. reallistically this will always be true as errors will be thrown otherwise.
33:      */
34:     public function orderAdd($order) {
35:         $_params = array("order" => $order);
36:         return $this->master->call('ecomm/order-add', $_params);
37:     }
38: 
39:     /**
40:      * Delete Ecommerce Order Information used for segmentation. This will generally be used by ecommerce package plugins
41: <a href="/plugins/ecomm360.phtml">that we provide</a> or by 3rd part system developers.
42:      * @param string $store_id
43:      * @param string $order_id
44:      * @return associative_array with a single entry:
45:      *     - complete bool whether the call worked. reallistically this will always be true as errors will be thrown otherwise.
46:      */
47:     public function orderDel($store_id, $order_id) {
48:         $_params = array("store_id" => $store_id, "order_id" => $order_id);
49:         return $this->master->call('ecomm/order-del', $_params);
50:     }
51: 
52:     /**
53:      * Retrieve the Ecommerce Orders for an account
54:      * @param string $cid
55:      * @param int $start
56:      * @param int $limit
57:      * @param string $since
58:      * @return associative_array the total matching orders and the specific orders for the requested page
59:      *     - total int the total matching orders
60:      *     - data array structs for each order being returned
61:      *         - store_id string the store id generated by the plugin used to uniquely identify a store
62:      *         - store_name string the store name collected by the plugin - often the domain name
63:      *         - order_id string the internal order id the store tracked this order by
64:      *         - email string the email address that received this campaign and is associated with this order
65:      *         - order_total double the order total
66:      *         - tax_total double the total tax for the order (if collected)
67:      *         - ship_total double the shipping total for the order (if collected)
68:      *         - order_date string the date the order was tracked - from the store if possible, otherwise the GMT time we received it
69:      *         - items array structs for each line item on this order.:
70:      *             - line_num int the line number
71:      *             - product_id int the product id
72:      *             - product_name string the product name
73:      *             - product_sku string the sku for the product
74:      *             - product_category_id int the category id for the product
75:      *             - product_category_name string the category name for the product
76:      *             - qty int the quantity ordered
77:      *             - cost double the cost of the item
78:      */
79:     public function orders($cid=null, $start=0, $limit=100, $since=null) {
80:         $_params = array("cid" => $cid, "start" => $start, "limit" => $limit, "since" => $since);
81:         return $this->master->call('ecomm/orders', $_params);
82:     }
83: 
84: }
85: 
86: 
87: 
API documentation generated by ApiGen 2.8.0