# Price movers

Want to showcase products that have recently dropped in price? The **Price Movers** feature lets you do exactly that—by displaying products with the biggest recent discounts, either as a widget or shortcode block.

<figure><img src="https://4254262503-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M3fnB7iKYwDc1Xhr3H3%2Fuploads%2FCnObwceWpxKWQ2283hyH%2Fimage.png?alt=media&#x26;token=08a34482-514d-4132-9f7b-893987c986d8" alt=""><figcaption></figcaption></figure>

### How It Works

Content Egg tracks historical price data for each product in your site’s database. This allows it to detect **price drops** and display the best deals based on configurable filters.

{% hint style="info" %}
**Note:** Price history builds up over time. You need several update cycles before the Price Movers feature has enough data to display meaningful results.
{% endhint %}

### Configuration

You can control the tracking period via:

**Settings → Content Egg → Price Alerts → Price Drop Period**

This sets the **maximum age (in days)** of price history used to compare old vs. new prices. A longer period increases the chance of detecting a discount.

<figure><img src="https://4254262503-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M3fnB7iKYwDc1Xhr3H3%2Fuploads%2FN8vcXMCSWIbyOrodQdhW%2Fimage.png?alt=media&#x26;token=a42b0641-60d7-4862-92f0-d4e73bd55912" alt=""><figcaption></figcaption></figure>

### Price Movers Widget

The **Price Movers Widget** lets you display a sidebar or block section with the top discounted products during a given period.

<figure><img src="https://4254262503-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M3fnB7iKYwDc1Xhr3H3%2Fuploads%2FXH70F5MZZ6e48ioz1U3o%2Fimage.png?alt=media&#x26;token=fba4ed73-8aa0-4f42-8455-822defa46c4a" alt="" width="347"><figcaption></figcaption></figure>

**To use:**

1. Go to **Appearance → Widgets**
2. Add the **“Price Movers”** widget to your desired sidebar or block area.
3. Set options such as:
   * Number of products to show
   * Drop type: absolute or relative
   * Timeframe for last price update
   * Included/excluded modules

> After adjusting the "Price Drop Period", wait for the next scheduled price update. The changes will apply only after new price history is recorded.

### Price Movers on Pages (Shortcode)

You can also show discounted products directly on pages (e.g., homepage, category page, etc.) using a shortcode.

#### Basic Example:

```plaintext
[content-egg-price-movers template=wdgt_price_movers_list limit=3]
```

<figure><img src="https://4254262503-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M3fnB7iKYwDc1Xhr3H3%2Fuploads%2FuHfb18rhiVG3wbvdkddZ%2Fimage.png?alt=media&#x26;token=fa9958fa-e48c-4e4e-9447-1b03e5da888a" alt=""><figcaption></figcaption></figure>

#### Full Example with Options:

```plaintext
[content-egg-price-movers template=wdgt_price_movers_grid limit=20 drop_type=absolute direction=drops last_update=7 include_module_ids=Amazon,Ebay2 exclude_module_ids=Walmart]
```

#### Available Shortcode Parameters

| Parameter            | Description                                                            |
| -------------------- | ---------------------------------------------------------------------- |
| `limit`              | Number of products to display (default: `5`)                           |
| `drop_type`          | Type of drop: `absolute` (raw value) or `relative` (percentage)        |
| `direction`          | `drops` (price decreases) or `increases` (price hikes)                 |
| `last_update`        | Max age (in days) of last update to consider (e.g., `7`)               |
| `include_module_ids` | Comma-separated list of module IDs to include (e.g., `Amazon,Walmart`) |
| `exclude_module_ids` | Comma-separated list of module IDs to exclude                          |
| `template`           | Layout: `price_movers_grid` or `price_movers_list`                     |

### Tips

* Ensure **price history is enabled** in module settings.
* Price Movers needs at least **two recorded prices per product** to calculate changes.

Here is a clearer, more professional, and user-friendly rewrite of your **Custom Price Movers Templates** documentation section:

***

### Custom Price Movers 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 output of the **Price Movers** widget by creating 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_list.php` (List view)
   * `wdgt_price_movers_grid.php` (Grid view)
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 make any changes needed to the layout, HTML structure, or 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>
```

#### Using the Custom Template

Once created, your custom template will appear in the **Price Movers widget** template dropdown with a `[custom]` prefix.

<figure><img src="https://4254262503-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M3fnB7iKYwDc1Xhr3H3%2Fuploads%2Fh4JIEv2gNjS9nYmWbQdj%2Fimage.png?alt=media&#x26;token=68b3805a-04ab-46ee-9a41-9b10e3c87cc5" alt="" width="375"><figcaption></figcaption></figure>

To use it with a **shortcode**, specify the template name (without the `.php` extension):

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

Make sure to use the `custom/` prefix, and ensure the filename matches exactly what you specify in the shortcode.
