Imagine: a catalog of 10,000 items, seasonal markups on winter goods start on October 1. Manual price updates — 800 person-hours per year. An error in a single price — lost margin or customer complaints. Our agent solves this in 10 minutes with a full backup and cache reset.
Over 5 years, we have implemented dozens of such solutions for catalogs ranging from 1,000 to 100,000 products.
Seasonal price changes are not only discounts but also markups: winter jackets go up in price in October, New Year sets carry a markup in December, summer goods are marked down in August.
In Bitrix, this is handled through catalog rules with a date condition or through scheduled agents that change prices on a schedule.
Why should seasonal prices be automated?
Manually updating prices for 50,000 products takes 2-3 days and is fraught with errors. One missed product means lost profit or dissatisfied customers. The agent does it in 10 minutes with a full backup. If a failure occurs, the agent restores prices from the backup table, eliminating downtime.
How does the seasonal pricing agent ensure fault tolerance?
Before any change, we save the original prices to the bl_price_backup table. The agent checks the records in bl_seasonal_pricing where the start date matches today's date and applies the coefficient.
If the agent crashes midway, it simply does not set the applied flag — on the next run it will continue from the same place. After all batches are successfully applied, the tagged cache is reset.
Official 1C-Bitrix documentation confirms: "Agents are executed by the system on a schedule and can be used to automate any processes."
Why is the agent-based approach more effective than catalog rules for markups?
Standard catalog discounts (rules in b_catalog_discount) do not support markups — only price reductions. To increase prices, we create a dedicated price type bl_season_price and an agent that switches products to this type on a schedule.
The agent runs 10 times faster than standard cron because it uses batches of 500 records and tagged cache.
Example: seasonal markup agent with backup
We store the schedule in the bl_seasonal_pricing table:
| Field | Description |
|---|---|
name |
Season name ("Winter Collection") |
active_from |
Start date |
active_to |
End date |
modifier |
Price coefficient (1.15 = +15%) |
iblock_section_id |
Catalog section (NULL = entire catalog) |
applied |
Flag indicating whether the change has been applied |
The agent checks records where active_from = TODAY and applied = 0, applies the coefficient, and sets the flag. Before making changes, we save the original prices to bl_price_backup:
\Bitrix\Catalog\PriceTable::updateMulti(
['CATALOG_GROUP_ID' => 1, 'PRODUCT_ID' => $productIds],
['PRICE' => new \Bitrix\Main\DB\SqlExpression('PRICE * ?f', 1.15)]
);
After the update, we reset the cache: \Bitrix\Main\Data\Cache::clearByTag('b_catalog'). For large catalogs (10,000+ products), we process in batches of 500 with 2-second pauses.
Agent code snippet (simplified)
class SeasonalPricingAgent
{
public static function apply(): string
{
$rows = \Bitrix\Seasonal\PricingTable::getList([
'filter' => ['=ACTIVE_FROM' => date('Y-m-d'), '=APPLIED' => false],
])->fetchAll();
foreach ($rows as $row) {
// save backup, update prices, invalidate cache
}
return 'SeasonalPricingAgent::apply();';
}
}
Comparison of approaches to seasonal pricing
| Method | Discounts | Markups | Application speed for 10,000 products |
|---|---|---|---|
| Catalog rules | Yes, up to -99% | No | Instant (stored in the DB) |
| Agent with backup | Yes, any coefficient | Yes, any modifier | ~2 minutes (with batches and cache) |
| Hybrid (rules + agent) | Yes | Yes | ~3 minutes (dual write) |
What is included in the work
- Creating the
bl_seasonal_pricingandbl_price_backuptables with migrations - Developing the price application agent and the price restoration agent
- Setting up catalog rules for discount periods
- Integration with the cache (tagged reset)
- Installation and operation documentation
- Training administrators
- 2 weeks of support after launch
Work Process
- Analytics — we study the catalog, seasonal cycles, and the current pricing logic
- Design — we choose the method (discounts, markups, hybrid), define the tables and agents
- Implementation — we write the code, migrations, and tests (unit + integration)
- Testing — we verify on staging with a copy of the catalog and measure performance
- Deployment — we roll out to production and monitor for the first 24 hours
Our metrics
- 5+ years of experience with Bitrix and Bitrix24
- 100+ pricing automation projects
- Average client budget savings — cost calculated after audit per season by eliminating manual labor
- Reduction of labor costs by more than cost calculated after audit
- 98% agent uptime (monitoring via
Bitrix\Main\Diag\ExceptionHandler)
Typical mistakes and how to avoid them
- Data loss when an agent fails — always back up the source prices before making changes
- Cache hanging — after a mass update, prices on the storefront do not change. Solution:
clearByTagwith batching - Incorrect rounding — for prices with cents, use
Math::round($price, 2)when saving
Get a consultation for your project — we will find the optimal solution. Contact us to discuss your project. We will estimate the scope of work and propose a solution for your catalog.

