> For the complete documentation index, see [llms.txt](https://ce-docs.keywordrush.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ce-docs.keywordrush.com/updating-products/price-drops.md).

# Price Drops

Price Drops – show the products that just got cheaper

The **Price drops** block lists products that cost less than they usually do. The discount is counted against the product's usual price, so a price that was high for a week and went back to normal is never shown as a sale.

<figure><img src="https://4254262503-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M3fnB7iKYwDc1Xhr3H3%2Fuploads%2Fgit-blob-42a89ff449153baab260c9c2a7872306cc27b368%2Fprice-drops-block.webp?alt=media" alt=""><figcaption><p>The Price drops block, Grid template</p></figcaption></figure>

It reads the prices Content Egg saves for every product, the same ones the [Price History](/updating-products/price-history.md) block uses. Turn on **Price History** first: **Content Egg > Settings > Price alerts > Price History**.

### Add Price Drops to a Page

* **Block editor:** add the **Price drops** block (in the **Content Egg** group).
* **Shortcode:**

```
[content-egg-price-drops limit=8]
```

* **Sidebar:** go to **Appearance > Widgets** and add **CE: Price Movers**. It shows the same cards. The List template suits a narrow sidebar.

The older shortcode `[content-egg-price-movers]` shows the same cards too.

### What Counts as a Price Drop

* **The usual price** is the typical price of the 90 days before the drop. Each price counts for the days it held, and days out of stock do not count. A price that stays low keeps its discount for as long as it stays low.
* **The discount** is the percentage below the usual price, rounded down. A drop shows from 5%. You can change that in the block settings.
* **The drop date** is the day the price fell to today's level. "Dropped within" in the block settings decides how old a drop may be. The default is 60 days.
* **History needed.** A product needs 7 days of price history before it can show. To change this, go to **Content Egg > Settings > Price alerts** and set **Price drops: minimum history** (7, 14 or 30 days).
* **One card per product.** The same product in several shops or posts shows once, with the biggest discount. Products with the same EAN count as one.
* **Lowest in 90 days.** The badge shows when today's price is the lowest of the last 90 days. A product needs 90 days of history for it.
* **Errors.** A discount of 90% or more shows only after the next price check confirms the price. A price hidden as an error, and a product that is out of stock, never show.

### Templates

Choose a template in the block settings, or with `template=` in the shortcode.

* **Grid** (`grid`): the default. A picture, the discount and the usual price.

<figure><img src="https://4254262503-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M3fnB7iKYwDc1Xhr3H3%2Fuploads%2Fgit-blob-bd0578bdedc936a0429bf8e370b89af2aaa766e3%2Fprice-drops-chart.webp?alt=media" alt=""><figcaption><p>Chart template</p></figcaption></figure>

* **Chart** (`chart`): the 30-day chart is the main part of the card. The line drops below the dashed usual-price line.

<figure><img src="https://4254262503-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M3fnB7iKYwDc1Xhr3H3%2Fuploads%2Fgit-blob-6797194102e7213359f3d43a9a8c6c8221aa30f4%2Fprice-drops-verdict.webp?alt=media" alt=""><figcaption><p>Verdict template</p></figcaption></figure>

* **Verdict** (`verdict`): a box that says how far below the usual price the product is, with the low, typical and high bar from the Price History block.

<figure><img src="https://4254262503-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M3fnB7iKYwDc1Xhr3H3%2Fuploads%2Fgit-blob-e0fdbc8c14aabe26b300d81881b46cd43096f205%2Fprice-drops-list.webp?alt=media" alt=""><figcaption><p>List template</p></figcaption></figure>

* **List** (`list`): a narrow list for a sidebar.

The title and picture of a card link to the post that holds the product, or to the shop if you choose so. The button always goes to the shop. It is a solid button in the colour of your **Button Variant** setting (an outline variant becomes solid), and its text is the button text setting.

### Block Settings

<figure><img src="https://4254262503-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M3fnB7iKYwDc1Xhr3H3%2Fuploads%2Fgit-blob-8a021709dc5a33fc1420cd6a8e8379ad05f0a766%2Fprice-drops-editor.webp?alt=media" alt=""><figcaption><p>The Price drops block in the block editor</p></figcaption></figure>

* **Template** and **Sort**: biggest discount, newest drop or biggest saving.
* **Number of products** (up to 48) and **Columns** (1 to 6).
* **Dropped within**: 7, 14, 30, 60 or 90 days.
* **Minimum discount** in percent.
* **Title and picture link to**: the post with the product (default) or the shop.
* **Show the 30-day chart**: adds a small chart to the Grid and List templates. It is off by default. The Chart template always shows it.
* **Filters**: post category and tag IDs (subcategories are included), and the modules to use or leave out.

### Shortcode Parameters

```
[content-egg-price-drops template=verdict limit=6 columns=3 dropped_within=30 min_discount=10 categories=12]
```

| Parameter            | Description                                                  |
| -------------------- | ------------------------------------------------------------ |
| `template`           | `grid` (default), `chart`, `verdict` or `list`               |
| `limit`              | Number of products, up to 48 (default `8`)                   |
| `columns`            | Columns, 1 to 6 (default `4`)                                |
| `dropped_within`     | `7`, `14`, `30`, `60` (default) or `90` days                 |
| `min_discount`       | Smallest discount in percent (default `5`)                   |
| `sort`               | `discount` (default), `newest` or `savings`                  |
| `categories`         | Post category IDs, comma-separated                           |
| `tags`               | Post tag IDs, comma-separated                                |
| `include_module_ids` | Modules to use, e.g. `Amazon,Ebay2`                          |
| `exclude_module_ids` | Modules to leave out                                         |
| `chart`              | `true` adds the 30-day chart                                 |
| `link_to`            | `post` (default) or `shop`: where the title and picture link |

You can also use `hide`, `btn_text` and `btn_variant`, like in the other blocks.

### The Old Shortcode and Widget

`[content-egg-price-movers]` and the **CE: Price Movers** widget show the same cards. They start with the List template and link the title and picture to the shop; `template` and `link_to` change that. Their old parameters still work:

| Old parameter                                                 | Same as                            |
| ------------------------------------------------------------- | ---------------------------------- |
| `last_update`                                                 | `dropped_within`                   |
| `drop_type=relative`                                          | `sort=discount`                    |
| `drop_type=absolute`                                          | `sort=savings`                     |
| `cols`                                                        | `columns`                          |
| `template=wdgt_price_movers_grid` or `wdgt_price_movers_list` | `template=grid` or `template=list` |

`direction=increases` still lists price increases the old way.

### Change the Texts

The words on the cards ("Usually", "Lowest in 90 days", "Dropped 3 days ago") are in **Content Egg > Frontend > Frontend Texts**.

### AI Agents

An AI agent can read the same list with the `price-drops` ability and read the prices of a post with `get-price-history`. Both are read-only. See [AI agents](/ai-agents/ai-agents.md).

***

### Custom Price Drops Templates

{% hint style="warning" %}
**Advanced Users Only:** This section is intended for developers or users comfortable editing PHP templates.
{% endhint %}

You can fully customize the cards with your own template.

#### Steps to Create a Custom Template

1. **Locate Default Templates**\
   Navigate to the following directory in your WordPress installation:

   ```
   /wp-content/plugins/content-egg/templates/
   ```

   Copy one of the following files:

   * `wdgt_price_movers_grid.php`
   * `wdgt_price_movers_chart.php`
   * `wdgt_price_movers_verdict.php`
   * `wdgt_price_movers_list.php`
2. **Paste into the Custom Template Directory**\
   Create a new directory if it doesn't already exist:

   ```
   /wp-content/content-egg-templates/
   ```

   Paste your copied file into this directory.
3. **Rename the File**\
   Rename the file while keeping the `wdgt_` prefix. For example:

   ```
   wdgt_price_movers_custom.php
   ```
4. **Edit the Template**\
   Open the file and change the layout, the HTML or the styling.
5. **Include the Default CSS and a Div Container** (optional)\
   To include the default CSS, add the following code to your template:

```php
\ContentEgg\application\components\BlockTemplateManager::getInstance()->enqueueCeggStyle(true);
```

Next, add the following div container:

```html
<div class="cegg5-container">
<!-- Inside this container, you can use Bootstrap 5 classes -->
</div>
```

#### What the Template Receives

Each item in `$items` is the product with two extra fields:

* `$item['_price_drop']`: `price`, `usual`, `discount` (percent), `saving`, `drop_date` (`Y-m-d`), `lowest_90` (true or false), `currency`, `post_url`, `post_id` and `spark` (the small chart as SVG, empty when the chart is off).
* `$item['_price_movers']`: the fields the old templates read. `price_old` is the usual price, `discount_percent` and `discount_value` are the discount, and `price_old_date` and `create_date` are the drop date.

#### Using the Custom Template

Your template appears in the widget's **Template** dropdown with a `[custom]` prefix. To use it in a shortcode, give the name without `.php`:

```php
[content-egg-price-movers template=custom/wdgt_price_movers_custom limit=10]
```

Use the `custom/` prefix, and make sure the file name matches exactly.
