/** * Prepare and sends user data if user placed order. * event - place_order * * @return bool */ function fn_triggmine_place_order($order_id, $action, $order_status, $cart, $auth) { if ($order_id) { $userInfo = array(); $user_id = $auth['user_id']; $u_data = fn_get_user_info($user_id, false); if (!empty($u_data['email'])) { $userInfo['BuyerEmail'] = $u_data['email']; } if (!empty($u_data['firstname'])) { $userInfo['FirstName'] = $u_data['firstname']; } if (!empty($u_data['lastname'])) { $userInfo['LastName'] = $u_data['lastname']; } if (!empty($u_data['birthday'])) { $userInfo['BuyerBirthday'] = $u_data['birthday']; } if (!empty($u_data['phone'])) { $userInfo['PhoneNumber'] = $u_data['phone']; } $integrator = Triggmine_Integrator_CS_Cart::singleton(); $integrator->_onCartPurchased($userInfo); return true; } else { return false; } }
<?php if ($mode == 'logout') { $integrator = Triggmine_Integrator_CS_Cart::singleton(); $integrator->_onBuyerLoggedOut(); }