本文整理汇总了PHP中mslib_fe::getFeUserTTaddressDetails方法的典型用法代码示例。如果您正苦于以下问题:PHP mslib_fe::getFeUserTTaddressDetails方法的具体用法?PHP mslib_fe::getFeUserTTaddressDetails怎么用?PHP mslib_fe::getFeUserTTaddressDetails使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mslib_fe
的用法示例。
在下文中一共展示了mslib_fe::getFeUserTTaddressDetails方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: die
if (!defined('TYPO3_MODE')) {
die('Access denied.');
}
//$cart=$GLOBALS['TSFE']->fe_user->getKey('ses', $this->cart_page_uid);
require_once \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('multishop') . 'pi1/classes/class.tx_mslib_cart.php';
$mslib_cart = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('tx_mslib_cart');
$mslib_cart->init($this);
$cart = $mslib_cart->getCart();
if (count($cart['products']) < 1) {
$content .= '<div class="noitems_message">' . $this->pi_getLL('there_are_no_products_in_your_cart') . '</div>';
} else {
if (mslib_fe::loggedin()) {
if (isset($cart['user']['first_name']) && isset($cart['user']['street_name'])) {
$user = $cart['user'];
} else {
$billing_address = mslib_fe::getFeUserTTaddressDetails($GLOBALS['TSFE']->fe_user->user['uid']);
if (is_array($billing_address)) {
$user = array();
$user['first_name'] = $billing_address['first_name'];
$user['middle_name'] = $billing_address['middle_name'];
$user['last_name'] = $billing_address['last_name'];
$user['gender'] = $billing_address['gender'] == 0 ? "m" : "f";
$user['company'] = $billing_address['company'];
$user['tx_multishop_newsletter'] = $billing_address['tx_multishop_newsletter'];
$user['address_ext'] = $billing_address['address_ext'];
$user['building'] = $billing_address['building'];
$user['street_name'] = $billing_address['street_name'];
$user['address_number'] = $billing_address['address_number'];
$user['address'] = $billing_address['building'] . ' ' . $billing_address['street_name'] . ' ' . $billing_address['address_number'] . ($billing_address['address_ext'] ? '-' . $billing_address['address_ext'] : '');
$user['address'] = preg_replace('/\\s+/', ' ', $user['address']);
$user['zip'] = $billing_address['zip'];
示例2: time
$insertArray['delivery_address_ext'] = $this->post['delivery_address_ext'];
$insertArray['delivery_room'] = '';
$insertArray['delivery_region'] = '';
$insertArray['delivery_country'] = $this->post['delivery_country'];
$insertArray['delivery_telephone'] = $this->post['delivery_telephone'];
$insertArray['delivery_mobile'] = $this->post['delivery_mobile'];
$insertArray['delivery_fax'] = '';
$insertArray['delivery_vat_id'] = '';
$insertArray['bill'] = 1;
$insertArray['crdate'] = time();
$insertArray['shipping_method'] = $this->post['shipping_method'];
$insertArray['payment_method'] = $this->post['payment_method'];
$insertArray['shipping_method_costs'] = $this->post['shipping_method_costs'];
$insertArray['payment_method_costs'] = $this->post['payment_method_costs'];
$insertArray['cruser_id'] = $GLOBALS['TSFE']->fe_user->user['uid'];
$delivery_address = mslib_fe::getFeUserTTaddressDetails($customer_id, 'delivery');
if ($delivery_address) {
$this->post['different_delivery_address'] = true;
$insertArray['delivery_email'] = $delivery_address['email'];
$insertArray['delivery_company'] = $delivery_address['company'];
$insertArray['delivery_first_name'] = $delivery_address['first_name'];
$insertArray['delivery_middle_name'] = $delivery_address['middle_name'];
$insertArray['delivery_last_name'] = $delivery_address['last_name'];
$insertArray['delivery_telephone'] = $delivery_address['telephone'];
$insertArray['delivery_mobile'] = $delivery_address['mobile'];
$insertArray['delivery_gender'] = $delivery_address['gender'];
$insertArray['delivery_building'] = $delivery_address['building'];
$insertArray['delivery_street_name'] = $delivery_address['street_name'];
$insertArray['delivery_address_number'] = $delivery_address['address_number'];
$insertArray['delivery_address_ext'] = $delivery_address['address_ext'];
$insertArray['delivery_address'] = preg_replace('/ +/', ' ', $delivery_address['street_name'] . ' ' . $delivery_address['address_number'] . ' ' . $delivery_address['address_ext']);
示例3: ucfirst
$subpartArray['###VALUE_CUSTOMER_ID###'] = $this->get['tx_multishop_pi1']['cid'];
if ($_GET['action'] == 'edit_customer') {
$subpartArray['###LABEL_BUTTON_SAVE###'] = ucfirst($this->pi_getLL('update_account'));
} else {
$subpartArray['###LABEL_BUTTON_SAVE###'] = ucfirst($this->pi_getLL('save'));
}
$subpartArray['###LOGIN_AS_THIS_USER_LINK###'] = $login_as_this_user_link;
$customer_details = '';
$markerArray = array();
if ($this->post['image']) {
$markerArray['CUSTOMER_IMAGE'] = '<div class="msAdminFeUserImage"><img src="uploads/pics/' . $this->post['image'] . '" width="' . $size[0] . '" /></div>';
} else {
$markerArray['CUSTOMER_IMAGE'] = '';
}
$customer_billing_address = mslib_fe::getFeUserTTaddressDetails($this->get['tx_multishop_pi1']['cid']);
$customer_delivery_address = mslib_fe::getFeUserTTaddressDetails($this->get['tx_multishop_pi1']['cid'], 'delivery');
if ($customer_billing_address['name'] && $customer_billing_address['phone'] && $customer_billing_address['email']) {
$fullname = $customer_billing_address['name'];
$telephone = $customer_billing_address['phone'];
$email_address = $customer_billing_address['email'];
} else {
$fullname = $this->post['name'];
$telephone = $this->post['telephone'];
$email_address = $this->post['email'];
}
$company_name = '';
if ($customer_billing_address['address'] && $customer_billing_address['zip'] && $customer_billing_address['city']) {
$company_name = $customer_billing_address['company'];
$billing_street_address = $customer_billing_address['address'];
$billing_postcode = $customer_billing_address['zip'] . ' ' . $customer_billing_address['city'];
$billing_country = ucwords(mslib_befe::strtolower($customer_billing_address['country']));
示例4: convertCartToOrder
//.........这里部分代码省略.........
$insertArray['city'] = $address['delivery_city'];
$insertArray['country'] = $address['delivery_country'];
$insertArray['gender'] = $address['delivery_gender'];
$insertArray['birthday'] = strtotime($address['delivery_birthday']);
if ($address['delivery_gender'] == 'm') {
$insertArray['title'] = 'Mr.';
} else {
if ($address['delivery_gender'] == 'f') {
$insertArray['title'] = 'Mrs.';
}
}
$insertArray['region'] = $address['delivery_state'];
}
$insertArray['pid'] = $this->conf['fe_customer_pid'];
$insertArray['page_uid'] = $this->shop_pid;
$insertArray['tstamp'] = time();
$insertArray['tx_multishop_customer_id'] = $customer_id;
$insertArray['tx_multishop_address_type'] = 'delivery';
$insertArray['tx_multishop_default'] = 0;
$insertArray = mslib_befe::rmNullValuedKeys($insertArray);
$query = $GLOBALS['TYPO3_DB']->INSERTquery('tt_address', $insertArray);
$res = $GLOBALS['TYPO3_DB']->sql_query($query);
// ADD TT_ADDRESS RECORD EOF
//hook to let other plugins further manipulate the create table query
if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/multishop/pi1/classes/class.tx_mslib_user.php']['createUserPostProc'])) {
$params = array('customer_id' => &$customer_id);
foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/multishop/pi1/classes/class.tx_mslib_user.php']['createUserPostProc'] as $funcRef) {
\TYPO3\CMS\Core\Utility\GeneralUtility::callUserFunction($funcRef, $params, $this);
}
}
}
} else {
// insert tt_address for existing customer if no record found
if (!mslib_fe::getFeUserTTaddressDetails($customer_id, 'billing')) {
// ADD TT_ADDRESS RECORD
$insertArray = array();
$insertArray['tstamp'] = time();
$insertArray['company'] = $address['company'];
$insertArray['name'] = $address['first_name'] . ' ' . $address['middle_name'] . ' ' . $address['last_name'];
$insertArray['name'] = preg_replace('/\\s+/', ' ', $insertArray['name']);
$insertArray['first_name'] = $address['first_name'];
$insertArray['middle_name'] = $address['middle_name'];
$insertArray['last_name'] = $address['last_name'];
$insertArray['email'] = $address['email'];
if (!$address['street_name']) {
// fallback for old custom checkouts
$insertArray['building'] = $address['building'];
$insertArray['street_name'] = $address['address'];
$insertArray['address_number'] = $address['address_number'];
$insertArray['address_ext'] = $address['address_ext'];
$insertArray['address'] = $insertArray['street_name'] . ' ' . $insertArray['address_number'] . ($insertArray['address_ext'] ? '-' . $insertArray['address_ext'] : '');
$insertArray['address'] = preg_replace('/\\s+/', ' ', $insertArray['address']);
} else {
$insertArray['building'] = $address['delivery_building'];
$insertArray['street_name'] = $address['street_name'];
$insertArray['address_number'] = $address['address_number'];
$insertArray['address_ext'] = $address['address_ext'];
$insertArray['address'] = $address['address'];
}
$insertArray['zip'] = $address['zip'];
$insertArray['phone'] = $address['telephone'];
$insertArray['mobile'] = $address['mobile'];
$insertArray['city'] = $address['city'];
$insertArray['country'] = $address['country'];
$insertArray['gender'] = $address['gender'];
$insertArray['birthday'] = strtotime($address['birthday']);
示例5: saveUserBillingAddress
function saveUserBillingAddress($customer_id, $is_default = true)
{
if (mslib_fe::getFeUserTTaddressDetails($customer_id, 'billing')) {
// insert billing into tt_address
$updateArray = array();
$updateArray['tstamp'] = time();
$updateArray['company'] = $this->company;
$updateArray['name'] = $this->name;
$updateArray['first_name'] = $this->first_name;
$updateArray['middle_name'] = $this->middle_name;
$updateArray['last_name'] = $this->last_name;
$updateArray['email'] = $this->email;
$updateArray['street_name'] = $this->address;
$updateArray['address_number'] = $this->address_number;
$updateArray['address_ext'] = $this->address_ext;
$updateArray['address'] = $updateArray['street_name'] . ' ' . $updateArray['address_number'];
if ($updateArray['address_ext']) {
$updateArray['address'] .= '-' . $updateArray['address_ext'];
}
$updateArray['zip'] = $this->zip;
$updateArray['phone'] = $this->telephone;
$updateArray['mobile'] = $this->mobile;
$updateArray['city'] = $this->city;
$updateArray['country'] = $this->country;
// fe user table holds integer as value: 0 is male, 1 is female
// but in tt_address its varchar: m is male, f is female
switch ($this->gender) {
case '0':
case 'm':
$updateArray['gender'] = 'm';
break;
case '1':
case 'f':
$updateArray['gender'] = 'f';
break;
case '2':
case 'c':
$updateArray['gender'] = 'c';
break;
}
$updateArray['birthday'] = strtotime($this->birthday);
$updateArray['title'] = $this->gender == 'm' ? 'Mr.' : 'Mrs.';
$updateArray['region'] = $this->region;
$updateArray['pid'] = $this->ref->conf['fe_customer_pid'];
$updateArray['page_uid'] = $this->ref->shop_pid;
$updateArray['tstamp'] = time();
$updateArray['tx_multishop_address_type'] = 'billing';
$updateArray['tx_multishop_default'] = $is_default ? 1 : 0;
$updateArray['tx_multishop_customer_id'] = $customer_id;
$updateArray = mslib_befe::rmNullValuedKeys($updateArray);
//hook to let other plugins further manipulate the create table query
if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/multishop/pi1/classes/class.tx_mslib_user.php']['saveUserBillingAddressUpdatePreHook'])) {
$params = array('updateArray' => &$updateArray);
foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/multishop/pi1/classes/class.tx_mslib_user.php']['saveUserBillingAddressUpdatePreHook'] as $funcRef) {
\TYPO3\CMS\Core\Utility\GeneralUtility::callUserFunction($funcRef, $params, $this);
}
}
$query = $GLOBALS['TYPO3_DB']->UPDATEquery('tt_address', 'tx_multishop_customer_id=' . $customer_id, $updateArray);
$res = $GLOBALS['TYPO3_DB']->sql_query($query);
if ($res) {
return true;
} else {
//echo $GLOBALS['TYPO3_DB']->sql_error();
//die();
}
} else {
// insert billing into tt_address
$insertArray = array();
$insertArray['tstamp'] = time();
$insertArray['company'] = $this->company;
$insertArray['name'] = $this->name;
$insertArray['first_name'] = $this->first_name;
$insertArray['middle_name'] = $this->middle_name;
$insertArray['last_name'] = $this->last_name;
$insertArray['email'] = $this->email;
$insertArray['street_name'] = $this->address;
$insertArray['address_number'] = $this->address_number;
$insertArray['address_ext'] = $this->address_ext;
$insertArray['address'] = $insertArray['street_name'] . ' ' . $insertArray['address_number'];
if ($insertArray['address_ext']) {
$insertArray['address'] .= '-' . $insertArray['address_ext'];
}
$insertArray['zip'] = $this->zip;
$insertArray['phone'] = $this->telephone;
$insertArray['mobile'] = $this->mobile;
$insertArray['city'] = $this->city;
$insertArray['country'] = $this->country;
// fe user table holds integer as value: 0 is male, 1 is female
// but in tt_address its varchar: m is male, f is female
switch ($this->gender) {
case '0':
case 'm':
$insertArray['gender'] = 'm';
break;
case '1':
case 'f':
$insertArray['gender'] = 'f';
break;
case '2':
case 'c':
//.........这里部分代码省略.........