With the price history, affiliate-toolkit records every price change of your products, separately for each shop. You can show the development as a chart on your site, so visitors see at a glance whether the current price is a good deal.
Prerequisites: the affiliate-toolkit base plugin with imported products and the Price History extension. The extension is included in the affiliate-toolkit passes.
Install and activate
- Download the ZIP file of the extension from your account.
- Upload it under Plugins → Add New → Upload Plugin and activate it.
- Enter the license key under affiliate-toolkit → Settings → Licenses to receive updates.
There is nothing else to configure. Recording starts as soon as the extension is active.
Prices are recorded only from the moment of installation. Older prices cannot be added later, so install the extension early if you want to show a meaningful history.
How prices are recorded
Whenever a product is updated, either by the scheduled update or when you save it, the extension compares the current sale price of each shop with the last recorded price:
- A new entry is only written if the price has actually changed.
- There is at most one entry per product, shop and day. If the price changes several times a day, the entry of that day is overwritten with the latest price.
- Offers without a price are not recorded.
In the product you find the new tab Price History. It lists the last 50 entries with shop, price and date.

Chart: price history of the last 30 days
The template pricehistory_lastxdays shows a line chart with the lowest price per day for each shop over the last 30 days.
[atkp_product id='123' template='pricehistory_lastxdays'][/atkp_product]
Replace 123 with the ID of your product. On a product page you can leave out the id; the shortcode then uses the product of the current page.
Chart: monthly price history
The template pricehistory_month shows the average price per month and shop for the last six months. It suits products whose prices change slowly.
[atkp_product id='123' template='pricehistory_month'][/atkp_product]
Both templates also appear in the template selection of the shortcode generator. The charts only contain shops that are currently assigned to the product; if you remove a shop from a product, its line disappears from the chart.
Use the data in PHP
If you build your own output, you can read the recorded prices directly. The class atkp_product_pricehistory provides three static methods:
| Method | Returns |
|---|---|
load_history( $productid, $max_items = 20 ) | The latest entries of the product, newest first, without grouping. |
get_lastxdays_history( $productid, $minifier_shops, $lastxdays ) | The lowest price per day (and per shop) for the current shops of the product. groupname contains the date. |
get_monthly_history( $productid, $minifier_shops ) | The average price per month (and per shop) for the current shops of the product. groupname contains year and month, e.g. 2026-9. |
| Parameter | Description |
|---|---|
$productid | ID of the affiliate-toolkit product. |
$minifier_shops | true combines all shops into one value per day or month; false returns one row per shop. |
$lastxdays | Number of days to go back. |
$max_items | Maximum number of entries. |
Each method returns an array of objects with these properties: id, productid, shopid, price (formatted price text), pricefloat (price as number), createdon (date and time) and groupname.
if ( class_exists( 'atkp_product_pricehistory' ) ) {
// lowest price per day and shop for the last 30 days
$rows = atkp_product_pricehistory::get_lastxdays_history( 123, false, 30 );
foreach ( $rows as $row ) {
echo esc_html( $row->groupname . ' | shop ' . $row->shopid . ' | ' . $row->pricefloat ) . '<br>';
}
}To change an entry before it is saved, use the filter atkp_modify_pricehistory_before_db_write:
add_filter( 'atkp_modify_pricehistory_before_db_write', function ( $data ) {
// $data: ProductId, ShopId, ProductPrice, ProductPriceFloat, CreatedOn
return $data;
} );Maintenance
The prices are stored in a separate database table (wp_atkp_pricehistory with the default table prefix). Under affiliate-toolkit → Tools → Debug in the section Tables you see whether the table exists, and you find two buttons:
- Clean price history (duplicate data will be deleted): keeps only the last entry per product, shop and day.
- Drop & create atkp_pricehistory table (data will be deleted): deletes the table with all recorded prices and creates it again.
Both actions cannot be undone. Create a database backup before you use them.
Troubleshooting
The chart is empty or shows only one point
The history grows with every price change. Right after installation, or for products with stable prices, there is little data. Check the Price History tab of the product to see what has been recorded.
No new entries are added
Entries are only written when products are updated. If your products are not updated regularly, check the cron job and see My products are not updated.
A shop is missing in the chart
The charts only show shops that are currently assigned to the product and have a price.