Scheduled Prices feature overviewEdit on GitHub
The Scheduled Prices feature lets shop administrators schedule price changes, which are to happen in the future for multiple products simultaneously.
Instead of changing prices manually, you can prepare a list of prices with time frames that are to be applied automatically. For example, if you want to increase the prices of the products that are in great demand on a certain date before Christmas eve and decrease them on a certain date afterward. The Scheduled Prices feature lets you specify prices and the dates beforehand.
An in-built cron job switches the prices on the specified dates for all the specified products automatically. Apart from major events, you can use this feature to update prices across the shop without having to do it manually for each product since the feature lets you do it from one place in bulk.
The feature only works with the following price types:
A default price is the one that is shown as the real price of the product.
An original price is the one that, in the frontend, is shown as a strikethrough to identify that the price has been used before the default price was applied, as if there is a promotion.
You can define price schedules using any time zone. For example, the following value defines the price application time in Europe/Berlin time zone: 2019-06-23T23:00:00+02:00.
Even though you can use any time zone for defining a price schedule, in the database, the time is saved in the UTC time zone.
Defining product price schedules
You can define price schedules as follows: Import a CSV file with a list of prices. This option is for bulk operations. You can import the file through Back Office or manually. Add a price schedule to a single abstract or concrete product. This option is suitable for working with a small number of products. For details, see Edit abstract products and product bundles.
Once imported, prices do not get updated right away. To automate price application, a cron job shipped with the feature. The cron job checks if there are any imported scheduled prices that need to be applied or reverted. If there is a price schedule that passes its starting or ending date, the cron job applies the changes.
By default, the cron job runs every day at 00:06:00-00:00. In some cases, it might be necessary to change this behavior. For example, if you schedule a price to be updated at 00:01:00-00:00, the price is updated at 00:06:00-00:00 since that’s when the cron job runs. 00:01:00-00:00. In this case, you can schedule the cron job to be run at 00:01:00-00:00. When you add, edit, or delete a price schedule while editing a product, the cron job runs automatically for this single product.
The default number of prices, which the cron job can process at a time, is 1000. If you have more prices to be updated, the cron job only updates the first 1000 prices. You can change the number in
If you import prices that need to be applied right away, you can run
price-product-schedule:apply console command. This command applies the imported prices in the current store. If needed, you can specify the store by adding a store relation parameter. For example, you would use the following command to apply imported prices in the US store:
APPLICATION_STORE=US console price-product-schedule:apply.
Unlike imported price schedules, the price schedules added, deleted, or edited from the Edit Product page trigger the cron job to be run at once for the modified product.
Scheduled price application logic
You can schedule multiple prices on overlapping dates. For example, you define the following schedule:
- Scheduled price #1 takes effect between 01.01 and 31.07.
- Scheduled price #2 takes effect between 25.02 and 08.06.
- Scheduled price #3 takes effect between 01.03 and 01.04.
In this case:
Scheduled price #1 is applied on 01.01 and remains active till scheduled price #2 gets applied on 25.02.
Scheduled price #2 remains active until scheduled price #3 gets applied on 01.03.
When the active period of scheduled price #3 ends on 01.04, the price reverts back to scheduled price #2.
When the active period of scheduled price #2 ends on 08.06, the price reverts back to scheduled price #1.
When there are no scheduled prices left to apply, the ORIGINAL price specified outside of the scheduled price logic gets applied.
When there are no scheduled prices left to apply, and the ORIGINAL price is not specified outside of the scheduled price logic, you can add the product to the cart, and its price won’t be displayed.
The feature has the following functional constraints which are going to be resolved in the future.
- The default number of prices that the cron job can process at a time is 1000.
- The feature does not work with merchant prices (relations) and volume prices.
Related Business User documents
|BACK OFFICE USER GUIDES
|Manage scheduled prices
Related Developer documents
|TUTORIALS AND HOWTOS
|Integrate the Scheduled prices feature
|Upgrade the PriceProductSchedule module
|File details: product_price_schedule.csv
|HowTo: Schedule cron job for Scheduled Prices
|Upgrade the PriceProductScheduleGui module
For submitting the form