Setting up Content Display by Region in 1C-Bitrix
When geolocation has determined user region, content must change based on it: prices, phones, banners, delivery conditions, assortment. Bitrix has no single "regional content" mechanism — it's a set of patterns, each applied to its data type.
Regional prices through catalog price types
Most demanded scenario in e-commerce. catalog module supports multiple price types (b_catalog_price_type): "Retail Moscow", "Retail Regions", "Wholesale", etc. Each price type is tied to user groups.
Logic: user from Moscow → group msk_users → price type retail_msk. When determining region by IP or city selection, add user to needed group (CUser::SetUserGroup() or through session) or set price type directly:
// In init.php or component after region determination
$regionPriceType = getRegionPriceType($_SESSION['USER_REGION']['city']);
define('REGION_PRICE_TYPE', $regionPriceType);
In catalog component pass PRICE_ID = REGION_PRICE_TYPE — components bitrix:catalog.element and bitrix:catalog.section use this parameter to select needed price from b_catalog_price.
Regional text content
Phones, addresses, delivery conditions — most often change by region. Two approaches:
Infoblocks "Regions" with content attached to each region. Properties: CITY_CODE, PHONE, OFFICE_ADDRESS, DELIVERY_DESCRIPTION. In template request element with filter by region code:
$regionData = CIBlockElement::GetList(
[],
['IBLOCK_ID' => REGIONS_IBLOCK_ID, 'PROPERTY_CITY_CODE' => $_SESSION['USER_REGION']['city_code']],
false,
['nTopCount' => 1]
);
Site options (b_option) with region suffix: phone_msk, phone_spb. Simpler for small number of regions, inconvenient when scaling.
For regional content on pages use conditional blocks in template — check $_SESSION['USER_REGION']['city_code'] and output corresponding block. For cached components this is a problem: cache must be different for different regions.
Caching and regions: critical moment
Component cache in Bitrix is keyed by component parameters and URL. With regional content cache must be different for different regions, otherwise first Moscow user will "cache" Moscow content for everyone.
Solution: add region to cache key through CACHE_ADDITIONAL_ID:
$APPLICATION->IncludeComponent('bitrix:news.list', '.default', [
'CACHE_TYPE' => 'A',
'CACHE_TIME' => 3600,
'CACHE_ADDITIONAL_ID' => $_SESSION['USER_REGION']['city_code'] ?? 'default',
// ...
]);
Or disable cache for regional blocks (CACHE_TYPE = 'N') — only for components where content really changes by region. Leave cache of other content untouched.
Regional banners and promotions
Banners and promo blocks with regional attachment — through infoblock with REGIONS property (type "Link to infoblock" or list). In component filter by current region:
$filter = [
'IBLOCK_ID' => BANNERS_IBLOCK_ID,
'ACTIVE' => 'Y',
[
'LOGIC' => 'OR',
'PROPERTY_REGIONS' => $_SESSION['USER_REGION']['city_code'],
'PROPERTY_REGIONS' => 'all', // Banners for all regions
]
];
For banners definitely key cache by region — otherwise Moscow banner will be seen by Novosibirsk users.
Regional delivery
Delivery conditions by regions managed in sale module through delivery services (b_sale_delivery_service) and their zones. Delivery cost calculated based on LOCATION_CODE from b_sale_location. With properly configured region detection and attachment to b_sale_location, delivery calculation works automatically.







