Skip to content

Dynamic Pricing


The Dynamic Pricing module allows you to change the product's pricing based on quantity. With the help of this module, you can increase the pricing of your best-selling product when the quantity is low. At the same time, the price can reduce depending on the remaining quantity. The module also allows you to increase or decrease the product price based on its sale over a specific period.


The Dynamic Pricing module is compatible with the following Magento platforms:

Community Edition (Open Source) Enterprise Edition (Commerce) Cloud Edition
2.3.0 - 2.4.* 2.3.0 - 2.4.* 2.3.0 - 2.4.*


Installing module using zip file

  • Unzip and paste the extension file into your root Magento folder.
  • Connect to your server by SSH.
  • Go to your Magento root folder.
  • To install the extension, perform this command:
php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento setup:static-content:deploy

Composer installation

If this is your first time installing an Aitoc module, you will first need to add your Aitoc composer repository. Please review the document to see how you can add a composer repository.

To install the module, you will need to run the following commands:

composer require aitoc/module-dynamicpricing
php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento setup:static-content:deploy -f
  • To switch the extension on/off, perform these commands:
php bin/magento module:enable Aitoc_DynamicPricing
php bin/magento module:disable Aitoc_DynamicPricing
  • To update the module, use below command:
composer update aitoc/module-microsoft-clarity

How the module works

The Dynamic Pricing module extends the default Magento's Catalog Price rule functionality. It provides additional options to select when setting up conditions. Please check Magento's Catalog Price rules guide to learn how the rule works.

When the module is installed and enabled, you will see the "Qty remaining" and "Sales Performance" option in the dropdown for setting up conditions.

Qty remaining

This condition will check the available quantity of the product. Selecting the "Qty Remaining" option provides a text field where the numeric value needs to be specified. This value will be the product stock value. When product stock matches the value defined for Qty Remaining condition, the rule will apply to that product.


For the Magento Multi-Source Inventory functionality, the Qty Remaining attribute will be considered the quantity assigned to the "Quantity per Source/Quantity" field and not the Salable Quantity.

Sales performance

Selecting "Sales Performance" allows you to define the percentage of the product sale that is increased or decreased over a specific time.

This condition calculates the product's sale performance based on Magento's native sales "bestseller" report data. When the rule is triggered, it checks the "bestsellers" table. It compares the current and historical data to determine if any product's sales performance matches the condition defined in the rule.

As an example:

Suppose today is 18th November 10:00 am. Based on the condition defined in the above image, the module will check the sales performance of the products for the past two days. This means the module will check the "bestseller" table and composer the data of 16-17th November with 14-15th November.

Similarly, instead of the "last two days," if the "last 7 days" condition is used, the module will compare the data of 11-17th November with 4-10th November.


The Sale performance considers all the orders for product sale, no matter on which store/website the order is placed.

The percentage of sale performance you define is the range, not the specific percentage value. For ex: In the above example, the rule will apply if the product's sale performance is increased by 20% or more. This means if any product is sold 60% more than the last two days, then the condition will match for that product, and the rule will apply.

Increasing and Decreasing product price

Under the action tab, you need to select and define how you want the price changed (Fixed price, percentage of price).

To increase the product price when the condition match, enter the negative value on the Discount Amount field (-10, as an example).

To decrease the product price when the condition match, enter the integer value (10, as an example).

Changing the value/price of the product for Price and Cost Attribute

In the action tab, you can select the attribute to be used as a base for the price calculations.

So, suppose the "Price" is selected for the Discount Based on the option. In that case, the final product price will be calculated based on the product's price attribute.

If the "Cost" is selected for the Discount Based on the option, the Discount will be applied to the Cost attribute value of the product.

Example to understand how the rule works

As you can see in the above screenshot, the catalog price rule has been set up to be applied to the product when the available product quantity is greater than 80 and the product is part of category ID 2.

The 10 value has been mentioned in the Discount Amount field. The Discount Type is a fixed amount, which will be applied to the value defined on the price attribute.

Before applying the rule, the price of the product is $100

Product Admin Price Front-end

When the rule mentioned above is applied, the product price will be changed to 90 because in the Discount amount value, "10" was defined, so the value defined in the price attribute decreased by 10.

Another example of understanding change in Product Cost attribute price

Similarly, in the below example, the catalog rule has been created. It will be applied for the product with a remaining quantity value equal to or greater than 80. The product is part of category ID 2.

When the rule is applied, the value defined on the "Cost" attribute will be increased by 5% as the discount amount is defined with a negative sign.

Before the rule is applied, the price cost attribute value is 50.

After the rule is applied, the cost attribute value will be increased by 5%.