Advertisement
sparkweb

MailChimp Ecommerce360

Feb 6th, 2014
265
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.95 KB | None | 0 0
  1. //Send to ecommerce360
  2. $item_array = array();
  3. foreach($transaction->transaction_details->transaction_detail as $transaction_detail) {
  4.     $item_array[] = array(
  5.         "product_id" => (string)$transaction_detail->product_code,
  6.         "product_name" => (string)$transaction_detail->product_name,
  7.         "category_id" => 1,
  8.         "category_name" => "Products",
  9.         "qty" => (double)$transaction_detail->product_quantity,
  10.         "cost" => (double)$transaction_detail->product_price,
  11.     );
  12. }
  13.  
  14. $order = array(
  15.     "id" => $transaction_id,
  16.     "email_id" => $custom_fields['mc_eid'],
  17.     "email" => $customer_email,
  18.     "total" => (double)$transaction->order_total,
  19.     "order_date" => $transaction_date,
  20.     "shipping" => (double)$transaction->shipping_total,
  21.     "tax" => (double)$transaction->tax_total,
  22.     "store_id" => (string)$transaction->store_id,
  23.     "store_name" => "YOUR STORE NAME",
  24.     "campaign_id" => $custom_fields['mc_cid'],
  25.     "items" => $item_array,
  26.  
  27. );
  28. $retval = $api->ecommOrderAdd($order);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement