本文整理汇总了PHP中ShopFunctions::getStateIDByName方法的典型用法代码示例。如果您正苦于以下问题:PHP ShopFunctions::getStateIDByName方法的具体用法?PHP ShopFunctions::getStateIDByName怎么用?PHP ShopFunctions::getStateIDByName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ShopFunctions
的用法示例。
在下文中一共展示了ShopFunctions::getStateIDByName方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: storeAddresses
function storeAddresses()
{
$this->cart = VirtueMartCart::getCart();
$addressST = $addressBT = array();
if ($this->response['SHIPTONAME'] == $this->response['FIRSTNAME'] . ' ' . $this->response['LASTNAME']) {
$firstName = $this->response['FIRSTNAME'];
$lastName = $this->response['LASTNAME'];
} else {
$shipToName = explode(' ', $this->response['SHIPTONAME']);
$firstName = $shipToName[0];
$lastName = '';
if (count($shipToName) > 1) {
$lastName = str_replace($firstName . ' ', '', $this->response['SHIPTONAME']);
}
}
$usersModel = VmModel::getModel('user');
$validateUserData = $usersModel->validateUserData($this->cart->BT, 'BT');
if ($validateUserData !== true) {
$addressBT['email'] = $this->response['EMAIL'];
$addressBT['first_name'] = $firstName;
$addressBT['last_name'] = $lastName;
$addressBT['address_1'] = $this->response['SHIPTOSTREET'];
$addressBT['city'] = $this->response['SHIPTOCITY'];
$addressBT['zip'] = $this->response['SHIPTOZIP'];
$addressBT['virtuemart_state_id'] = ShopFunctions::getStateIDByName($this->response['SHIPTOSTATE']);
$addressBT['virtuemart_country_id'] = ShopFunctions::getCountryIDByName($this->response['SHIPTOCOUNTRYCODE']);
$this->cart->saveAddressInCart($addressBT, 'BT', true);
}
$addressST['shipto_address_type_name'] = 'PayPal Account';
$addressST['shipto_first_name'] = $firstName;
$addressST['shipto_last_name'] = $lastName;
$addressST['shipto_address_1'] = $this->response['SHIPTOSTREET'];
$addressST['shipto_city'] = $this->response['SHIPTOCITY'];
$addressST['shipto_zip'] = $this->response['SHIPTOZIP'];
$addressST['shipto_virtuemart_state_id'] = ShopFunctions::getStateIDByName($this->response['SHIPTOSTATE']);
$addressST['shipto_virtuemart_country_id'] = ShopFunctions::getCountryIDByName($this->response['SHIPTOCOUNTRYCODE']);
$this->cart->STsameAsBT = 0;
$this->cart->setCartIntoSession();
$this->cart->saveAddressInCart($addressST, 'ST', true);
}
示例2: display
//.........这里部分代码省略.........
$adminIdUser = JFactory::getUser($this->adminID);
if ($adminIdUser->authorise('core.admin', 'com_virtuemart') or $adminIdUser->authorise('vm.user', 'com_virtuemart')) {
$this->allowChangeShopper = true;
}
}
}
}
if ($this->allowChangeShopper) {
$this->userList = $this->getUserList();
}
$task = $input->getString("vmtask");
if (file_exists(dirname(__FILE__) . "/" . $task . ".php")) {
require_once dirname(__FILE__) . "/" . $task . ".php";
}
if ($task == "completecheckout") {
require_once dirname(__FILE__) . "/updatecartaddress.php";
$checkout = $cart->checkoutData(false);
$app = JFactory::getApplication();
$messageQueue = $app->getMessageQueue();
$return_error = "";
if (count($messageQueue) > 0) {
foreach ($messageQueue as $message) {
$return_error .= $message['message'];
}
}
$returnarray = array();
if ($checkout) {
$returnarray["success"] = 1;
} else {
$returnarray["success"] = 0;
}
$returnarray['message'] = $return_error;
echo json_encode($returnarray);
exit;
}
if ($task == "ajaxshipment") {
$this->lSelectShipment();
echo json_encode($this->shipments_shipment_rates);
exit;
}
if ($task == "ajaxpayment") {
$this->lSelectPayment();
echo json_encode($this->paymentplugins_payments);
exit;
}
if ($task == "setsession") {
$payid = JRequest::getVar("payid", 0);
if ($payid > 0) {
$cart->setPaymentMethod(false, false, $payid);
$cart->setCartIntoSession();
}
echo "success";
exit;
}
if ($task == "klarnaupdate") {
$post = JRequest::get("post");
$address = array();
$address['shipto_address_type_name'] = 'ST';
if (!empty($post['given_name'])) {
$address['shipto_first_name'] = $post['given_name'];
}
if (!empty($post['family_name'])) {
$address['shipto_last_name'] = $post['family_name'];
}
if (!empty($post['street_address'])) {
$address['shipto_address_1'] = $post['street_address'];
}
if (!empty($post['street_address2'])) {
$address['shipto_address_2'] = $post['street_address2'];
}
if (!empty($post['postal_code'])) {
$address['shipto_zip'] = $post['postal_code'];
}
if (!empty($post['city'])) {
$address['shipto_city'] = $post['city'];
}
if (!empty($post['country'])) {
$address['shipto_virtuemart_country_id'] = ShopFunctions::getCountryIDByName($post['country']);
} else {
if (!empty($cart->BT['virtuemart_country_id'])) {
$address['shipto_virtuemart_country_id'] = $cart->BT['virtuemart_country_id'];
}
}
if (!empty($post['region'])) {
$address['shipto_virtuemart_state_id'] = ShopFunctions::getStateIDByName($post['region']);
}
if (!empty($post['phone'])) {
$address['shipto_phone_1'] = $post['phone'];
}
$address['tos'] = 1;
$cart->saveAddressInCart($address, 'ST', true, 'shipto_');
$cart->setCartIntoSession(false, true);
$return = array();
$return['response'] = "success";
echo json_encode($return);
exit;
}
$cart->setCartIntoSession();
parent::display($tpl);
}