Exemple #1
0
function getJsUserAddress(&$arResult, $USER_ID){

	if (CModule::IncludeModule("useraddress")){

		$arResult["USER_ADDRESS"] = CUserAddress::getAddressUser($USER_ID);

		foreach ($arResult["USER_ADDRESS"] as $key=>$arAddress) {
			$addressView = '';
			if (!empty($arAddress["STREET"]))
				$addressView .= 'ул. '.$arAddress["STREET"];

			if (!empty($arAddress["HOME"]))
				$addressView .= ', '.$arAddress["HOME"];

			if (!empty($arAddress["HOUSING"]))
				$addressView .= ' к.'.$arAddress["HOUSING"];

			if (!empty($arAddress["FLAT"]))
				$addressView .= ', кв. '.$arAddress["FLAT"];

			$arResult["USER_ADDRESS"][$key]["ADDRESS_VIEW"] = $addressView;

			if ($arAddress["DEFAULT_ADDRESS"] == "Y"){
				$arResult["SELECTED_USER_ADDRESS"] = $arAddress["ID"];
				if (!$isOrderPlaced){
					$new_location_id = getLocationFromAddress($arAddress["ID"]);
					if ($new_location_id > 0)
						$LOCATION_ID = $new_location_id;
				}
			}

			$arResult["JS_USER_ADDRESS"][$arAddress["ID"]]["CITY"] = $arAddress["CITY"];
			$arResult["JS_USER_ADDRESS"][$arAddress["ID"]]["STREET"] = $arAddress["STREET"];
			$arResult["JS_USER_ADDRESS"][$arAddress["ID"]]["FLAT"] = $arAddress["FLAT"];
			$arResult["JS_USER_ADDRESS"][$arAddress["ID"]]["HOUSE"] = $arAddress["HOME"];
			$arResult["JS_USER_ADDRESS"][$arAddress["ID"]]["KORPUS"] = $arAddress["HOUSING"];
		}
	}
	
}
Exemple #2
0
					if ($new_location_id > 0)
					   $LOCATION_ID = $new_location_id;
				}
				
				if(isset($_POST["ID_CITY"]) && $_POST["ID_CITY"] != '')
					$LOCATION_ID = $_POST["ID_CITY"];
				
				$_POST["ORDER_PROP_".$location_prop_id] = $LOCATION_ID;
				$arResult["SELECTED_USER_ADDRESS"] = intval($_POST["addrr-city-name"]);
			}
			elseif($_POST["IS_ADDRESS_NEW"] == "Y" && $_POST["IS_ADDRESS_SAVE"] == 'Y')
			{
				$arResult["SELECTED_USER_ADDRESS"] = 'last';
			}
			elseif (isset($_POST["del-addr-sel"]) && $_POST["del-addr-sel"] > 0){
				$new_location_id = getLocationFromAddress(intval($_REQUEST["del-addr-sel"]));

				if ($new_location_id > 0)
					$LOCATION_ID = $new_location_id;

				$_POST["ORDER_PROP_".$location_prop_id] = $LOCATION_ID;
				$arResult["SELECTED_USER_ADDRESS"] = intval($_POST["del-addr-sel"]);
			}
            
            
            
			/*Установка значения для доставки */
			if(isset($_POST["DELIVERY_CLICK"]) && $_POST["DELIVERY_CLICK"] != '')
				$arResult['DELIVERY_CLICK'] = $_POST["DELIVERY_CLICK"];