本文整理汇总了PHP中ShopFunctionsF::generateStAddressList方法的典型用法代码示例。如果您正苦于以下问题:PHP ShopFunctionsF::generateStAddressList方法的具体用法?PHP ShopFunctionsF::generateStAddressList怎么用?PHP ShopFunctionsF::generateStAddressList使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ShopFunctionsF
的用法示例。
在下文中一共展示了ShopFunctionsF::generateStAddressList方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: display
/**
* Displays the view, collects needed data for the different layouts
*
* @author Max Milbers
*/
function display($tpl = null)
{
$this->useSSL = tsmConfig::get('useSSL', 0);
$this->useXHTML = false;
tsmConfig::loadJLang('com_virtuemart_shoppers', TRUE);
$mainframe = JFactory::getApplication();
$pathway = $mainframe->getPathway();
$layoutName = $this->getLayout();
if ($layoutName == 'login') {
parent::display($tpl);
return;
}
if (empty($layoutName) or $layoutName == 'default') {
$layoutName = vRequest::getCmd('layout', 'edit');
if ($layoutName == 'default') {
$layoutName = 'edit';
}
$this->setLayout($layoutName);
}
$this->_model = tmsModel::getModel('user');
//$this->_model->setCurrent(); //without this, the administrator can edit users in the FE, permission is handled in the usermodel, but maybe unsecure?
$editor = JFactory::getEditor();
$virtuemart_user_id = vRequest::getInt('virtuemart_user_id', false);
if ($virtuemart_user_id and is_array($virtuemart_user_id)) {
$virtuemart_user_id = $virtuemart_user_id[0];
}
$this->_model->setId($virtuemart_user_id);
$this->userDetails = $this->_model->getUser();
$this->address_type = vRequest::getCmd('addrtype', 'BT');
$new = false;
if (vRequest::getInt('new', '0') == 1) {
$new = true;
}
if ($new) {
$virtuemart_userinfo_id = 0;
} else {
$virtuemart_userinfo_id = vRequest::getString('virtuemart_userinfo_id', 0);
}
$userFields = null;
if (!class_exists('VirtueMartCart')) {
require VMPATH_SITE . DS . 'helpers' . DS . 'cart.php';
}
$this->cart = VirtueMartCart::getCart();
$task = vRequest::getCmd('task', '');
if (($this->cart->_fromCart or $this->cart->getInCheckOut()) && empty($virtuemart_userinfo_id)) {
//New Address is filled here with the data of the cart (we are in the cart)
$fieldtype = $this->address_type . 'address';
$this->cart->prepareAddressFieldsInCart();
$userFields = $this->cart->{$fieldtype};
} else {
if ($task == 'addST') {
$this->address_type = 'ST';
}
if (!$new and empty($virtuemart_userinfo_id)) {
$virtuemart_userinfo_id = $this->_model->getBTuserinfo_id();
vmdebug('Try to get $virtuemart_userinfo_id by type BT', $virtuemart_userinfo_id);
}
$userFields = $this->_model->getUserInfoInUserFields($layoutName, $this->address_type, $virtuemart_userinfo_id, false);
if (!$new && empty($userFields[$virtuemart_userinfo_id])) {
$virtuemart_userinfo_id = $this->_model->getBTuserinfo_id();
vmdebug('$userFields by getBTuserinfo_id', $userFields);
}
$userFields = $userFields[$virtuemart_userinfo_id];
}
$this->virtuemart_userinfo_id = $virtuemart_userinfo_id;
$this->assignRef('userFields', $userFields);
if ($layoutName == 'edit') {
if ($this->_model->getId() == 0 && $this->_cuid == 0) {
$button_lbl = tsmText::_('COM_VIRTUEMART_REGISTER');
} else {
$button_lbl = tsmText::_('COM_VIRTUEMART_SAVE');
}
$this->assignRef('button_lbl', $button_lbl);
$this->lUser();
$this->shopper($userFields);
$this->payment();
$this->lOrderlist();
$this->lVendor();
}
$stTask = 'addST';
if ($task == 'editaddresscart') {
$stTask = 'editaddresscart';
}
$this->_lists['shipTo'] = ShopFunctionsF::generateStAddressList($this, $this->_model, $stTask);
$this->assignRef('lists', $this->_lists);
$this->assignRef('editor', $editor);
if ($layoutName == 'mailregisteruser') {
$vendorModel = tmsModel::getModel('vendor');
// $vendorModel->setId($this->_userDetails->virtuemart_vendor_id);
$vendor = $vendorModel->getVendor();
$this->assignRef('vendor', $vendor);
}
if ($layoutName == 'editaddress') {
$layoutName = 'edit_address';
$this->setLayout($layoutName);
//.........这里部分代码省略.........