当前位置: 首页>>代码示例>>PHP>>正文


PHP CSaleLocation::GetByZIP方法代码示例

本文整理汇总了PHP中CSaleLocation::GetByZIP方法的典型用法代码示例。如果您正苦于以下问题:PHP CSaleLocation::GetByZIP方法的具体用法?PHP CSaleLocation::GetByZIP怎么用?PHP CSaleLocation::GetByZIP使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CSaleLocation的用法示例。


在下文中一共展示了CSaleLocation::GetByZIP方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: array

 $arPropValues = $userProfile[$PROFILE_ID]["VALUES"];
 $arFilter = array("PERSON_TYPE_ID" => $PERSON_TYPE, "ACTIVE" => "Y", "UTIL" => "N");
 $dbProperties = CSaleOrderProps::GetList(array("SORT" => "ASC"), $arFilter, false, false, array("ID", "NAME", "TYPE", "REQUIED", "DEFAULT_VALUE", "IS_LOCATION", "PROPS_GROUP_ID", "SIZE1", "SIZE2", "DESCRIPTION", "IS_EMAIL", "IS_PROFILE_NAME", "IS_PAYER", "IS_LOCATION4TAX", "CODE", "GROUP_NAME", "GROUP_SORT", "SORT", "USER_PROPS", "IS_ZIP", "INPUT_FIELD_LOCATION", "SUBSCRIBE"));
 $locationZipID = "";
 $locationID = "";
 $profileName = "";
 $payerName = "";
 $payerEMail = "";
 //load location for the index if isset index
 $locationForZip = "";
 if (isset($_REQUEST["CHANGE_ZIP"]) && $_REQUEST["CHANGE_ZIP"] == "Y") {
     $arFilterZip = array("PERSON_TYPE_ID" => $PERSON_TYPE, "IS_ZIP" => "Y", "ACTIVE" => "Y", "UTIL" => "N");
     $dbPropertiesZip = CSaleOrderProps::GetList(array("SORT" => "ASC"), $arFilterZip, false, false, array("ID"));
     $arPropZip = $dbPropertiesZip->GetNext();
     $zipCode = htmlspecialcharsEx($_POST["ORDER_PROP_" . $arPropZip["ID"]]);
     $arZip = CSaleLocation::GetByZIP($zipCode);
     if (is_array($arZip) && count($arZip) > 1) {
         $locationForZip = intval($arZip["ID"]);
     }
 }
 while ($arProperties = $dbProperties->GetNext()) {
     if ((isset($_POST["BasketOrder"]) || $requestAjax || $_REQUEST["form"] == "Y") && $PROFILE_ID_OLD == $PROFILE_ID) {
         $curVal = htmlspecialcharsEx($_REQUEST["ORDER_PROP_" . $arProperties["ID"]]);
         if (intval($_REQUEST["NEW_LOCATION_" . $arProperties["ID"]]) > 0) {
             $curVal = intval($_POST["NEW_LOCATION_" . $arProperties["ID"]]);
         }
     } else {
         $curVal = $arPropValues[intval($arProperties["ID"])];
     }
     $arProperties["FIELD_NAME"] = "ORDER_PROP_" . $arProperties["ID"];
     if ($arProperties["REQUIED"] == "Y" || $arProperties["IS_EMAIL"] == "Y" || $arProperties["IS_PROFILE_NAME"] == "Y" || $arProperties["IS_LOCATION"] == "Y" || $arProperties["IS_LOCATION4TAX"] == "Y" || $arProperties["IS_PAYER"] == "Y" || $arProperties["IS_ZIP"] == "Y") {
开发者ID:webgksupport,项目名称:alpina,代码行数:31,代码来源:component.php

示例2: intval

CUtil::InitJSCore(array('core', 'ajax'));
$arParams["AJAX_CALL"] = $arParams["AJAX_CALL"] == "Y" ? "Y" : "N";
$arParams["COUNTRY"] = intval($arParams["COUNTRY"]);
$arParams["REGION"] = intval($arParams["REGION"]);
$arParams["LOCATION_VALUE"] = intval($arParams["LOCATION_VALUE"]);
$arParams["ALLOW_EMPTY_CITY"] = $arParams["ALLOW_EMPTY_CITY"] == "N" ? "N" : "Y";
$arParams["ZIPCODE"] = IntVal($arParams["ZIPCODE"]);
$arParams["SHOW_QUICK_CHOOSE"] = $arParams["SHOW_QUICK_CHOOSE"] == "N" ? "N" : "Y";
$arParams["ADMIN_SECTION"] = defined('ADMIN_SECTION') && ADMIN_SECTION === true ? "Y" : "N";
if ($arParams["ADMIN_SECTION"] != "Y") {
    if (strlen($arParams["SITE_ID"]) <= 0) {
        $arParams["SITE_ID"] = SITE_ID;
    }
}
if ($arParams["ZIPCODE"] > 0) {
    $arZip = CSaleLocation::GetByZIP($arParams["ZIPCODE"]);
    if (is_array($arZip) && count($arZip) > 1) {
        $arParams["LOCATION_VALUE"] = IntVal($arZip["ID"]);
    }
}
######################################################
######################################################
######################################################
if (!isset($arParams['CACHE_TIME'])) {
    $arParams['CACHE_TIME'] = 999999;
}
if (!isset($arParams['CACHE_TYPE'])) {
    $arParams['CACHE_TYPE'] = 'A';
}
// obtain cached data
$cacheNeeded = intval($arParams['CACHE_TIME']) > 0 && $arParams['CACHE_TYPE'] != 'N' && \Bitrix\Main\Config\Option::get("main", "component_cache_on", "Y") == "Y";
开发者ID:webgksupport,项目名称:alpina,代码行数:31,代码来源:component.php

示例3: getOrderPropFormated

function getOrderPropFormated($arProperties, $arResult, &$arUserResult, &$arDeleteFieldLocation = array())
{
    global $USER;
    $curVal = $arUserResult["ORDER_PROP"][$arProperties["ID"]];
    $curLocation = false;
    static $propertyGroupID = 0;
    static $propertyUSER_PROPS = "";
    // take data from user profile
    if ($arUserResult["PROFILE_CHANGE"] == "Y" && intval($arUserResult["PROFILE_ID"]) > 0 && !($arResult["HAVE_PREPAYMENT"] && $arUserResult["PROFILE_DEFAULT"] == "Y" && !empty($arResult["PREPAY_ORDER_PROPS"][$arProperties["CODE"]]))) {
        $dbUserPropsValues = CSaleOrderUserPropsValue::GetList(array("SORT" => "ASC"), array("USER_PROPS_ID" => $arUserResult["PROFILE_ID"], "ORDER_PROPS_ID" => $arProperties["ID"], "USER_ID" => intval($USER->GetID())), false, false, array("VALUE", "PROP_TYPE", "VARIANT_NAME", "SORT", "ORDER_PROPS_ID"));
        if ($arUserPropsValues = $dbUserPropsValues->Fetch()) {
            $valueTmp = "";
            if ($arUserPropsValues["PROP_TYPE"] == "MULTISELECT") {
                $arUserPropsValues["VALUE"] = explode(",", $arUserPropsValues["VALUE"]);
            }
            $curVal = $arUserPropsValues["VALUE"];
        }
    } elseif ($arUserResult["PROFILE_CHANGE"] == "Y" && intval($arUserResult["PROFILE_ID"]) <= 0) {
        if (isset($curVal)) {
            unset($curVal);
        }
    } elseif (isset($arUserResult["ORDER_PROP"][$arProperties["ID"]])) {
        $curVal = $arUserResult["ORDER_PROP"][$arProperties["ID"]];
    } elseif ($arResult["HAVE_PREPAYMENT"] && !empty($arResult["PREPAY_ORDER_PROPS"][$arProperties["CODE"]])) {
        $curVal = $arResult["PREPAY_ORDER_PROPS"][$arProperties["CODE"]];
        if ($arProperties["TYPE"] == "LOCATION") {
            $curLocation = $curVal;
        }
    }
    if (intval($_REQUEST["NEW_LOCATION_" . $arProperties["ID"]]) > 0) {
        $curVal = intval($_REQUEST["NEW_LOCATION_" . $arProperties["ID"]]);
    }
    $arProperties["FIELD_NAME"] = "ORDER_PROP_" . $arProperties["ID"];
    if (strlen($arProperties["CODE"]) > 0) {
        $arProperties["FIELD_ID"] = "ORDER_PROP_" . $arProperties["CODE"];
    } else {
        $arProperties["FIELD_ID"] = "ORDER_PROP_" . $arProperties["ID"];
    }
    if (intval($arProperties["PROPS_GROUP_ID"]) != $propertyGroupID || $propertyUSER_PROPS != $arProperties["USER_PROPS"]) {
        $arProperties["SHOW_GROUP_NAME"] = "Y";
    }
    $propertyGroupID = $arProperties["PROPS_GROUP_ID"];
    $propertyUSER_PROPS = $arProperties["USER_PROPS"];
    if ($arProperties["REQUIED"] == "Y" || $arProperties["IS_EMAIL"] == "Y" || $arProperties["IS_PROFILE_NAME"] == "Y" || $arProperties["IS_LOCATION"] == "Y" || $arProperties["IS_LOCATION4TAX"] == "Y" || $arProperties["IS_PAYER"] == "Y" || $arProperties["IS_ZIP"] == "Y") {
        $arProperties["REQUIED_FORMATED"] = "Y";
    }
    if ($arProperties["TYPE"] == "CHECKBOX") {
        if ($curVal == "Y" || !isset($curVal) && $arProperties["DEFAULT_VALUE"] == "Y") {
            $arProperties["CHECKED"] = "Y";
            $arProperties["VALUE_FORMATED"] = GetMessage("SOA_Y");
        } else {
            $arProperties["VALUE_FORMATED"] = GetMessage("SOA_N");
        }
        $arProperties["SIZE1"] = intval($arProperties["SIZE1"]) > 0 ? $arProperties["SIZE1"] : 30;
    } elseif ($arProperties["TYPE"] == "TEXT") {
        if (strlen($curVal) <= 0) {
            if (strlen($arProperties["DEFAULT_VALUE"]) > 0 && !isset($curVal)) {
                $arProperties["VALUE"] = $arProperties["DEFAULT_VALUE"];
            } elseif ($arProperties["IS_EMAIL"] == "Y") {
                $arProperties["VALUE"] = $USER->GetEmail();
            } elseif ($arProperties["IS_PAYER"] == "Y") {
                //$arProperties["VALUE"] = $USER->GetFullName();
                $rsUser = CUser::GetByID($USER->GetID());
                $fio = "";
                if ($arUser = $rsUser->Fetch()) {
                    $fio = CUser::FormatName(CSite::GetNameFormat(false), array("NAME" => $arUser["NAME"], "LAST_NAME" => $arUser["LAST_NAME"], "SECOND_NAME" => $arUser["SECOND_NAME"]), false, false);
                }
                $arProperties["VALUE"] = $fio;
            }
        } else {
            $arProperties["VALUE"] = $curVal;
        }
        //select ZIP for LOCATION
        if ($arProperties["IS_ZIP"] == "Y" && $arUserResult["PROFILE_CHANGE"] == "N") {
            $dbPropertiesLoc = CSaleOrderProps::GetList(array("ID" => "DESC"), array("PERSON_TYPE_ID" => $arUserResult["PERSON_TYPE_ID"], "ACTIVE" => "Y", "UTIL" => "N", "IS_LOCATION" => "Y"), false, false, array("ID"));
            $arPropertiesLoc = $dbPropertiesLoc->Fetch();
            if ($arPropertiesLoc["ID"] > 0) {
                $arZipLocation = array();
                if (strlen($curVal) > 0) {
                    $arZipLocation = CSaleLocation::GetByZIP($curVal);
                }
                $rsZipList = CSaleLocation::GetLocationZIP($arUserResult["ORDER_PROP"][$arPropertiesLoc["ID"]]);
                if ($arZip = $rsZipList->Fetch()) {
                    if (strlen($arZip["ZIP"]) > 0 && (empty($arZipLocation) || $arZipLocation["ID"] != $arUserResult["ORDER_PROP"][$arPropertiesLoc["ID"]])) {
                        $arProperties["VALUE"] = $arZip["ZIP"];
                    }
                }
            }
        }
        if ($arProperties["IS_ZIP"] == "Y") {
            $arUserResult["DELIVERY_LOCATION_ZIP"] = $arProperties["VALUE"];
        }
        $arProperties["VALUE"] = htmlspecialcharsEx($arProperties["VALUE"]);
        $arProperties["VALUE_FORMATED"] = $arProperties["VALUE"];
    } elseif ($arProperties["TYPE"] == "SELECT") {
        $arProperties["SIZE1"] = intval($arProperties["SIZE1"]) > 0 ? $arProperties["SIZE1"] : 1;
        $dbVariants = CSaleOrderPropsVariant::GetList(array("SORT" => "ASC", "NAME" => "ASC"), array("ORDER_PROPS_ID" => $arProperties["ID"]), false, false, array("*"));
        $flagDefault = "N";
        $nameProperty = "";
        while ($arVariants = $dbVariants->GetNext()) {
//.........这里部分代码省略.........
开发者ID:sharapudinov,项目名称:lovestore.top,代码行数:101,代码来源:functions.php

示例4: importZonesFromZipCsv

 /**
  * If zip codes imported to locations, we try to link regions to zones
  * using file /bitrix/modules/sale/delivery/rus_post/zip_zones.csv created
  * from http://info.russianpost.ru/database/tzones.html
  */
 public function importZonesFromZipCsv()
 {
     $COL_ZIP = 0;
     $COL_ZONE = 1;
     $csvFile = CSaleHelper::getCsvObject(DELIVERY_RP_CSV_PATH . '/zip_zones.csv');
     $arRes = $csvFile->Fetch();
     $arRegions = CSaleDeliveryHelper::getRegionsList();
     $arRegionsZones = array();
     while ($arRes = $csvFile->Fetch()) {
         $location = CSaleLocation::GetByZIP($arRes[$COL_ZIP]);
         if ($location === false) {
             continue;
         }
         if (isset($arRegions[$location['REGION_ID']])) {
             $arRegionsZones[$location['REGION_ID']] = $arRes[$COL_ZONE];
         }
         unset($arRegions[$location['REGION_ID']]);
         if (empty($arRegions)) {
             break;
         }
     }
     return $arRegionsZones;
 }
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:28,代码来源:delivery_rus_post.php

示例5: getOrderPropFormated


//.........这里部分代码省略.........
				}
				$arProperties["VALUE"] = $fio;
			}

			$arProperties["SOURCE"] = 'DEFAULT';
		}
		else
		{
			$arProperties["VALUE"] = $curVal;
			$arProperties["SOURCE"] = 'FORM';
		}

		//select ZIP for LOCATION
		if ($arProperties["IS_ZIP"] == "Y" && $arUserResult["PROFILE_CHANGE"] == "N")
		{
			$dbPropertiesLoc = CSaleOrderProps::GetList(
					array("ID" => "DESC"),
					array(
						"PERSON_TYPE_ID" => $arUserResult["PERSON_TYPE_ID"],
						"ACTIVE" => "Y",
						"UTIL" => "N",
						"IS_LOCATION" => "Y"
						),
					false,
					false,
					array("ID")
				);
			$arPropertiesLoc = $dbPropertiesLoc->Fetch();

			if ($arPropertiesLoc["ID"] > 0)
			{
				$arZipLocation = array();
				if(strlen($curVal) > 0)
					$arZipLocation = CSaleLocation::GetByZIP($curVal);

				$rsZipList = CSaleLocation::GetLocationZIP($arUserResult["ORDER_PROP"][$arPropertiesLoc["ID"]]);
				if($arZip = $rsZipList->Fetch())
				{
					if (strlen($arZip["ZIP"]) > 0 && (empty($arZipLocation) || $arZipLocation["ID"] != $arUserResult["ORDER_PROP"][$arPropertiesLoc["ID"]]))
						$arProperties["VALUE"] = $arZip["ZIP"];
				}
			}
		}

		if ($arProperties["IS_ZIP"]=="Y")
			$arUserResult["DELIVERY_LOCATION_ZIP"] = $arProperties["VALUE"];


		$arProperties["VALUE"] = htmlspecialcharsEx($arProperties["VALUE"]);
		$arProperties["VALUE_FORMATED"] = $arProperties["VALUE"];

		if ($isProfileChanged || $isEmptyUserResult)
		{
			$arUserResult["ORDER_PROP"][$arProperties["ID"]] = $arProperties["VALUE"];
		}

	}
	elseif ($arProperties["TYPE"] == "SELECT")
	{
		$arProperties["SIZE1"] = ((intval($arProperties["SIZE1"]) > 0) ? $arProperties["SIZE1"] : 1);
		$dbVariants = CSaleOrderPropsVariant::GetList(
				array("SORT" => "ASC", "NAME" => "ASC"),
				array("ORDER_PROPS_ID" => $arProperties["ID"]),
				false,
				false,
				array("*")
开发者ID:CheBurashka334,项目名称:zakrepi,代码行数:67,代码来源:functions.php

示例6: getOrderPropFormated


//.........这里部分代码省略.........
				}
				$arProperties["VALUE"] = $fio;
			}

			$arProperties["SOURCE"] = 'DEFAULT';
		}
		else
		{
			$arProperties["VALUE"] = $curVal;
			$arProperties["SOURCE"] = 'FORM';
		}

		//select ZIP for LOCATION
		if ($arProperties["IS_ZIP"] == "Y" && $arUserResult["PROFILE_CHANGE"] == "N")
		{
			$dbPropertiesLoc = CSaleOrderProps::GetList(
					array("ID" => "DESC"),
					array(
						"PERSON_TYPE_ID" => $arUserResult["PERSON_TYPE_ID"],
						"ACTIVE" => "Y",
						"UTIL" => "N",
						"IS_LOCATION" => "Y"
						),
					false,
					false,
					array("ID")
				);
			$arPropertiesLoc = $dbPropertiesLoc->Fetch();

			if ($arPropertiesLoc["ID"] > 0)
			{
				$arZipLocation = array();
				if(strlen($curVal) > 0)
					$arZipLocation = CSaleLocation::GetByZIP($curVal);

				$rsZipList = CSaleLocation::GetLocationZIP($arUserResult["ORDER_PROP"][$arPropertiesLoc["ID"]]);
				if($arZip = $rsZipList->Fetch())
				{
					if (strlen($arZip["ZIP"]) > 0 && (empty($arZipLocation) || $arZipLocation["ID"] != $arUserResult["ORDER_PROP"][$arPropertiesLoc["ID"]]))
						$arProperties["VALUE"] = $arZip["ZIP"];
				}
			}
		}

		if ($arProperties["IS_ZIP"]=="Y")
			$arUserResult["DELIVERY_LOCATION_ZIP"] = $arProperties["VALUE"];


		$arProperties["VALUE"] = htmlspecialcharsEx($arProperties["VALUE"]);
		$arProperties["VALUE_FORMATED"] = $arProperties["VALUE"];

	}
	elseif ($arProperties["TYPE"] == "SELECT")
	{
		$arProperties["SIZE1"] = ((intval($arProperties["SIZE1"]) > 0) ? $arProperties["SIZE1"] : 1);
		$dbVariants = CSaleOrderPropsVariant::GetList(
				array("SORT" => "ASC", "NAME" => "ASC"),
				array("ORDER_PROPS_ID" => $arProperties["ID"]),
				false,
				false,
				array("*")

		);
		$flagDefault = "N";
		$nameProperty = "";
		while ($arVariants = $dbVariants->GetNext())
开发者ID:akniyev,项目名称:arteva.ru,代码行数:67,代码来源:functions.php


注:本文中的CSaleLocation::GetByZIP方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。