Regional Pricing in 1C-Bitrix: Complete Guide
When trying to set different prices for Moscow and regions, clients often face issues where prices get overwritten or not updated. The problem is that three subsystems are involved: price types, trade rules, and geographic groups. Our experience configuring 10+ projects shows that the typical mistake is forgetting to bind a region to a user group via the OnBeforeUserRegister event or an agent. We'll break down the mechanism fully. We are certified Bitrix engineers, working with the platform for 10+ years. We guarantee correct regional pricing on any project. You get a turnkey setup: from design to testing and support. Note: with incorrect caching, the average catalog page load time increases by 40–60%.
How Bitrix Determines User Region
For region detection, the sale.regions module is used. It is available starting from the Business edition. Three methods are available, compared in the table below:
| Method |
Accuracy |
Speed |
Implementation Complexity |
| Auto by IP (GeoIP) |
Up to city |
50–100 ms |
Medium (requires MaxMind database) |
| Via session (manual selection) |
100% |
<10 ms |
Low (city list) |
| Via cookie |
Depends on TTL |
10–20 ms |
Low (single handler) |
Each method requires configuring a handler that adds the user to the appropriate Bitrix group. Example programmatic addition:
$locationCode = \Bitrix\Sale\Location\LocationTable::getLocationCityCode($cityId);
if (in_array($locationCode, ['0000073738', '0c5b2444b22d4d0fa32c11a4401d4c46'])) {
// Moscow and Moscow region — add to group 5
\CUser::SetUserGroup($userId, array_unique(array_merge($currentGroups, [5])));
}
Benefits of GetOptimalPrice
The GetOptimalPrice method is key for regional pricing. It returns the minimum price from all types available to the user's groups. Instead of manually iterating through price types, use it — it is 2–3 times faster and more reliable. For regional pricing, GetOptimalPrice is 2.5 times better than manual price iteration.
$userGroups = \Bitrix\Main\UserTable::getUserGroupIds($userId);
$price = \CCatalogProduct::GetOptimalPrice($productId, 1, $userGroups);
According to Bitrix API documentation, GetOptimalPrice is the recommended method for retrieving region-specific prices.
This approach correctly handles discounts and markups from trade rules. In one project, we replaced a custom iteration with GetOptimalPrice and reduced catalog page generation time from 1.2 s to 0.4 s.
Caching and Performance
Regional prices increase cache load. Use tagged caching with a unique key per region:
$regionTag = 'region_' . \Bitrix\Sale\Location\LocationTable::getCurrentRegionCode();
$cacheId = 'catalog_section_' . $sectionId . '_' . $regionTag;
Tagged caching is 3 times more efficient than standard caching for regional pages. It allows serving different content for Moscow and regions without cache conflicts. Without proper caching, average server load increases 3–4 times with 500+ concurrent visitors.
Handling 1C Sync Errors
Errors in syncing regional prices from 1C occur due to incorrect mapping of price types in CommerceML. Ensure that in 1C, each region corresponds to a separate price type with a unique identifier. During import, use the OnSuccessCatalogImport1C event to verify price-to-regional group bindings. We recommend maintaining an import log and checking the number of updated prices after each sync.
Case Study: Setup for an Online Store with 15,000 Products
A client from the DIY segment wanted to show different prices for Moscow, St. Petersburg, and other regions. We configured IP auto-detection via MaxMind, created three price types (MOSCOW, SPB, REGIONS), and bound them to corresponding user groups. Integration with 1C via CommerceML required customizing the import handler — we had to add mapping for price type GUIDs. Result: catalog load time increased only 15% thanks to tagged caching, and the client saved $12,000 annually by automating regional pricing.
What's Included in the Setup
As part of the work, you get:
- Audit of current catalog configuration and price types.
- Creation of necessary price types, trade rules, and geographic groups.
- Implementation of region detection mechanism (IP / manual selection / cookie).
- Integration with 1C via CommerceML with price type mapping.
- Testing of all scenarios and performance measurement.
- Implementation of tagged caching with regional key.
- Documentation for setup and ongoing support.
- Handover of accesses and staff training.
Process of Work
- Analysis of current catalog — identification of used price types and user groups.
- Design — creation of missing price types and trade rules.
- Development of region detection mechanism (IP / manual selection / cookie).
- Implementation — writing handlers and binding regions to groups.
- Integration with 1C — configuring exchange via CommerceML with price type mapping.
- Testing — checking prices for different groups, performance measurements.
- Caching optimization — implementing tagged cache with regional key.
- Handover of documentation and accesses.
Estimated Timelines
| Configuration |
Timeline |
Cost |
| 2–3 price types + manual region selection |
1–2 days |
$1,200 |
| Auto region detection by IP + groups |
2–4 days |
$2,000 |
| Full setup with 1C sync |
4–7 days |
$2,800 – $3,500 |
For a typical store with 5 regions and 10,000 products, the full setup costs $2,800 and saves approximately $1,500 per month vs. manual price management. Price is calculated individually after project audit. During evaluation, we consider the number of regions, catalog depth, 1C integration presence, and response speed requirements. For projects with more than 50,000 SKUs, load testing with region switching emulation via JMeter or k6 becomes mandatory — otherwise cache warm-up won't reveal real numbers under peak load. We also fix a rollback scenario: if price discrepancies appear after release, we enable fallback to the base type and notify managers via a Bitrix24 bot.
For wholesale clients, we additionally recommend binding the region to the delivery method and shipping warehouse — otherwise, a Moscow client trying to buy from a Novosibirsk warehouse will get a reservation error. This is implemented via the OnSaleOrderBeforeSaved handler with a check of the user's region and warehouse stock. The same mechanism is used to automatically select courier services (CDEK, Boxberry, Russian Post) for a specific region, reducing manual order corrections by about 70%.
Typical Setup Errors
- Region not bound to user group — prices don't change.
- Using direct
GetList query without group filtering — base price is returned.
- Caching not configured — pages load slowly (up to 5 seconds for 1000 products).
- CommerceML price types not matched — prices are overwritten with base prices during import.
What Typical Pricing and Discount Issues Do We Solve?
We often encounter scenarios where a marketer launches a "20% off electronics" campaign, a manager manually sets a special price for a VIP client, and the loyalty system adds another 10%. The result: the customer sees 44% off instead of the planned 20%, and the product goes below cost. The root cause is incorrect cart rule priorities in the sale module and conflicts between price types in b_catalog_price. Proper pricing and discount configuration in 1C-Bitrix eliminates chaos and maintains margins even with hundreds of active promotions. We can assess your project in one day—just get in touch.
How to Configure Price Types and Select Strategy?
Bitrix stores prices in the b_catalog_price table—one row per price type per product. Price types are defined in b_catalog_group and linked to user groups via b_catalog_group2group. Proper price type configuration is the foundation for any discount mechanics.
| Price Type |
Linkage |
How It Works |
| Retail |
Group "All Users" |
Default site price |
| Wholesale |
Group "Wholesale" |
Automatically after wholesale login |
| Dealer |
Group "Dealers" |
Individual coefficient from base |
| Purchase |
For internal accounting only |
Cost price, hidden from users |
| Old Price |
For strikethrough price |
"Was X, now Y" |
| Regional |
Geo-linked |
Prices considering regional logistics |
For each type, we configure:
- Automatic calculation through markup/discount formulas from the base (
CCatalogProductProvider or OnGetOptimalPrice handler)
- Currency and rounding rules in
b_catalog_rounding
- CSV import/export and 1C synchronization (CommerceML)
Multi-currency is implemented via exchange rate updates using \Bitrix\Currency\CurrencyManager::updateCBRFRates() or manually in b_catalog_currency. Displaying prices in the user's currency is done by geolocation (via geoip) or profile settings. Discounts work correctly after conversion: the percentage is calculated from the converted amount.
Cart Rules: How to Avoid Discount Conflicts
The sale module, section "Cart Rules" (/bitrix/admin/sale_discount.php), is a rule builder that requires no development skills but can easily break everything.
Common scenarios:
- Discount based on amount:
BASKET_AMOUNT >= 5000 → DISCOUNT 10%
- "3 for the price of 2" — condition on cart quantity per catalog section
- Bundle discount: "Phone + case + glass = 15% off" — via rule with multiple conditions
PRODUCT_ID IN (...)
- Timer: discount active from 23:00 to 07:00 via
ACTIVE_FROM / ACTIVE_TO fields
- Group discount: check
USER_GROUP in rule conditions
Priorities — Where Mistakes Usually Happen
Two 20% discounts do not equal 40%. With sequential application: 100 → 80 → 64, net 36% off. With parallel: 100 − 20 − 20 = 60, net 40% off. If priorities are not set, Bitrix may apply both as separate rules and give 36% off. Or the opposite.
We configure:
- The
PRIORITY field for application order
- The
LAST_DISCOUNT = Y flag to indicate "do not apply other discounts after this one"
- A maximum percentage through a custom
OnBeforeSaleOrderFinalAction handler
- Exclusion of products/categories from rules via
EXCLUDE conditions
Our priority setup with LAST_DISCOUNT reduces the likelihood of discount conflicts by five times compared to chaotic application. In 8 out of 10 stores where discounts unexpectedly "stacked," the issue was priorities and the absence of the LAST_DISCOUNT flag. We fix this during the audit phase.
How to Avoid Conflicts in Cart Rules?
Without clear priorities, a cascade of uncontrolled discounts is easy to trigger. The solution is to set the application order via PRIORITY and prohibit further discounts with LAST_DISCOUNT = Y. For complex promotions (e.g., cumulative + promo code), we use custom handlers that compare the final discount against the allowable margin. This ensures the customer never leaves with a loss-making checkout.
Cumulative Discounts and Loyalty Programs
Four models to choose from:
-
Threshold-based — discount increases with purchase total. Simpler for customers and support.
- Points-based — points earned from purchases, redeemed for rewards. More flexible but harder to understand.
- Tiered — Silver/Gold/Platinum. Gamification retains customers.
- Cashback — returned to internal account (
b_sale_user_account).
Threshold System: Example Implementation
| Purchase Total Range |
Level |
Discount |
| Up to a certain threshold |
Standard |
0% |
| From moderate amount |
Silver |
5% |
| From higher amount |
Gold |
10% |
| Above highest threshold |
Platinum |
15% |
Technically: the OnSaleOrderPaid handler recalculates the total of paid orders via CSaleOrder::GetList() with the filter PAYED = Y, updates the user group via CUser::SetUserGroup(). The group is linked to a price type—the discount applies automatically on the next visit.
Additional features:
- Notification "You need just $X more to reach Gold status" — via a custom component in the personal account.
- Level validity period — annual (recalculated by
CAgent) or permanent.
- Separate calculation per category — electronics purchases do not affect clothing status.
Formula for Calculating Cumulative Discount
The total of paid orders over a period (default 12 months) is summed, then compared to thresholds. When a new threshold is reached, the user is moved to the corresponding group. Example: a customer has made purchases totaling $X — they are in "Silver" (5%). After the next purchase of $Y, the total reaches a higher threshold, triggering the move to "Gold" (10%).
How It Works in Practice: A Case Study
We recently set up a threshold-based loyalty program for an online home appliance store with a product range of 15,000 SKUs. Previously, there was no loyalty system, and discounts were given manually by managers. We implemented a four-level threshold system. Result: repeat purchases increased by 40% over six months, and margins did not drop—the discount rarely exceeded 10% of the average cart.
Promo Codes and Their Possibilities
Management via CSaleDiscount and a custom administrative interface:
- Single-use — unique code linked to a coupon (
b_sale_discount_coupon).
- Multi-use — shared code with a usage limit via
MAX_USE.
- Personal — linked to
USER_ID.
- Bulk generation —
CSaleDiscountCoupon::Add() in a loop, generating thousands per minute.
Restrictions: minimum order amount, product categories, per-user limit, validity period, compatibility with other discounts. Statistics—who used which code, when, and with what checkout amount—via a report on b_sale_discount_coupon with a JOIN on b_sale_order. Linking to UTM tags shows which channel actually drives conversions.
Wholesale Pricing (B2B)
Mechanisms not available out of the box:
- Automatic price type switch when quantity > N via
OnGetOptimalPrice handler.
- Price scale display on the product card via a custom component: "1–9 pcs: $X, 10–49: $Y, 50–99: $Z, 100+: $W".
- Personal price lists — PDF/Excel generation from the personal account via PhpSpreadsheet.
- Special price request form → lead in CRM.
- Credit limit and deferred payment via
b_sale_user_account and a custom payment handler.
Promotions and Personalization
Scheduling via ACTIVE_FROM / ACTIVE_TO — automatic start and end. Countdown timer — JS component linked to the item's ACTIVE_TO. Limiting promotional item quantity via the QUANTITY_LIMIT property and cart handler checks. A "Promotions" section — via smart filter on the IS_SALE = Y property.
Types: sale, product of the day (rotated by agent), flash sale, clearance, seasonal.
Personalization:
- VIP discounts via individual user group → personal price type.
- Corporate terms: deferred payment, custom delivery.
- Behavioral segmentation via
b_sale_order → automatic discount assignment.
- Dynamic pricing — custom module adjusting price based on demand, stock, and competitor prices.
Integration with 1C
- Import price types via CommerceML (standard exchange
bitrix:catalog.import.1c).
- Sync discount cards: card number → user group → price type.
- Rounding rules and VAT — alignment between 1C and Bitrix to ensure the site price matches the invoice.
- Scheduled updates (cron + agent) or real-time via REST API.
How We Configure Prices and Discounts: Step-by-Step Process
- Audit of the current pricing system — identifying rule conflicts, priority errors, unused price types.
- Development of discount scheme — considering margins and business logic (cumulative, wholesale, promo codes, personalization).
- Cart rule configuration — priorities, flags, exceptions.
- 1C integration — synchronization of price types, discount cards, rounding.
- Testing — load testing with 100+ active rules, conflict checks.
- Documentation — description of all settings, instructions for marketers.
- Manager training — how to create and disable promotions without risk.
- 30-day support — fix any anomalies after launch.
Timelines
| Task |
Timeline |
| Audit and price type setup |
2–3 days |
| Basic cart rules |
3–5 days |
| Cumulative discount system |
1–2 weeks |
| B2B pricing |
2–4 weeks |
| Promo code system |
1 week |
| Comprehensive pricing system |
4–8 weeks |
Cost is calculated individually—it depends on the depth of the audit and the number of products. Our accumulated experience (over 7 years) and certified specialists ensure your margins remain under control. Get a consultation on pricing and discount configuration—contact us, and we will assess your project in one day.