本文整理汇总了PHP中shopFunctions::getStateIDByName方法的典型用法代码示例。如果您正苦于以下问题:PHP shopFunctions::getStateIDByName方法的具体用法?PHP shopFunctions::getStateIDByName怎么用?PHP shopFunctions::getStateIDByName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类shopFunctions
的用法示例。
在下文中一共展示了shopFunctions::getStateIDByName方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getUserInfoFromAmazon
private function getUserInfoFromAmazon ($amazonAddress, $prefix = '', $all = true, $getEmail = false) {
if ($amazonAddress->isSetName()) {
$userInfoData[$prefix . 'last_name'] = $amazonAddress->getName();
$userInfoData[$prefix . 'first_name'] = '';
}
if ($getEmail AND $amazonAddress->isSetEmail()) {
$userInfoData['email'] = $amazonAddress->getEmail();
}
if ($amazonAddress->isSetPhone()) {
$userInfoData['phone_1'] = $amazonAddress->getPhone();
}
if ($all) {
if ($amazonAddress->isSetAddressLine1()) {
$userInfoData[$prefix . 'address_1'] = $amazonAddress->getAddressLine1();
if ($amazonAddress->isSetAddressLine2()) {
$userInfoData[$prefix . 'address_2'] = $amazonAddress->getAddressLine2();
}
if ($amazonAddress->isSetAddressLine3()) {
$userInfoData[$prefix . 'address_2'] .= ", " . $amazonAddress->getAddressLine3();
}
} else {
if ($amazonAddress->isSetAddressLine2()) {
$userInfoData[$prefix . 'address_1'] = $amazonAddress->getAddressLine2();
}
if ($amazonAddress->isSetAddressLine3()) {
$userInfoData[$prefix . 'address_2'] = $amazonAddress->getAddressLine3();
}
}
if ($amazonAddress->isSetCity()) {
$userInfoData[$prefix . 'city'] = $amazonAddress->getCity();
}
if ($amazonAddress->isSetCounty()) {
//$userInfoData['county'] = $amazonAddress->getCounty();
}
if ($amazonAddress->isSetDistrict()) {
//$userInfoData['district'] = $amazonAddress->GetDistrict();
}
if ($amazonAddress->isSetStateOrRegion()) {
$stateId = shopFunctions::getStateIDByName($amazonAddress->GetStateOrRegion());
if ($stateId) {
$userInfoData[$prefix . 'virtuemart_state_id'] = $stateId;
} else {
$userInfoData[$prefix . 'virtuemart_state_id'] = 0;
}
}
if ($amazonAddress->isSetPostalCode()) {
$userInfoData[$prefix . 'zip'] = $amazonAddress->GetPostalCode();
}
if ($amazonAddress->isSetCountryCode()) {
$userInfoData[$prefix . 'virtuemart_country_id'] = shopFunctions::getCountryIDByName($amazonAddress->GetCountryCode());
}
}
return $userInfoData;
}