Basics of the calculation method
In order to calculate the lowest price information, we first need to collect price history of each product variant in the catalog. As price history begins to form the calculation begins by checking if the product is discounted or not. Based on this information there are three possible routes:
The product is discounted
We begin by indicating the date when the discount started. From the date when the discount started, we look back 30 days (or custom length set in settings) and pick the lowest price from that period. If the product has been on discount for longer than the maximum allowed length then the lowest prior price will be the lowest price from the past 30 days.
Not that the logic on identifying the start of the discount can be changed in settings. Instead of chosing the initial discount, it is possible to "reset" the discount start date whenever a price changes during a discount. This is required in countries like Poland.
The product is discounted and we do not have price history from the period prior to the discount
When the app has recently been installed, it is possible that we do not have information on the price prior to the discount. In this case, it is assumed that the price before the discount was the compare at price and that the product had not been discounted during the 30-day period prior to the discount. The compare at price is thus set as the lowest prior price.
The product is not discounted
The lowest prior price will be the lowest price from the past 30 days.