---
title: RightPress library hooks used by Pricepep
description: "Hooks of the RightPress library bundled with Pricepep 2.6: price engine, cart price display, Your Price, shop price cache, conditions and update notices."
url: "https://pricepep.com/docs/rightpress-library-hooks/"
updated: "2026-12-02"
category: Developers
---

# RightPress library hooks used by Pricepep

Pricepep includes the RightPress library, which runs the price engine, the conditions and the update checks. Its hooks start with `rightpress_`. These 58 hooks run in Pricepep 2.6 and are safe to use; most Pricepep-specific needs are covered by the [filter reference](/docs/filter-reference/) (`rp_wcdpd_` hooks), which you should prefer when both exist. See also the [action reference](/docs/action-reference/) and the [function reference](/docs/function-reference/).

## Which library hooks can I use?

### Loading

| Hook | What it is for |
| --- | --- |
| `rightpress_init` | Marks the point from which Pricepep's developer functions can be used (together with WooCommerce having loaded the cart from the session). |

### Conditions

| Hook | What it is for |
| --- | --- |
| `rightpress_conditions_match_guest_orders_by_billing_email` | Guest orders placed with the same billing email count as the customer's orders. |
| `rightpress_conditions_timeframes` | Same as rp_wcdpd_timeframes; prefer the rp_wcdpd_ filter. |
| `rightpress_current_user_capabilities` | Same as rp_wcdpd_current_user_capabilities; prefer the rp_wcdpd_ filter. |
| `rightpress_all_user_capabilities` | Add capabilities to the list (first of three filters; then rightpress_all_site_capabilities and rp_wcdpd_all_capabilities). |
| `rightpress_all_site_capabilities` | Same purpose as rp_wcdpd_all_capabilities. |
| `rightpress_custom_condition_taxonomies` | Same as rp_wcdpd_custom_condition_taxonomies. |
| `rightpress_custom_condition_taxonomy_object_types` | Same as rp_wcdpd_custom_condition_taxonomy_object_types. |
| `rightpress_bundle_cart_item_filter_flags` | Same as rp_wcdpd_bundle_cart_item_filter_flags. |
| `rightpress_bundle_cart_items_out_of_subtotals` | Leave bundle containers out of subtotal sums too, as before 2.6.0. |
| `rightpress_condition_shipping_method_all_packages` | Check only the first shipping package in the Shipping method condition. |
| `rightpress_wc_order_currency_rate` | Give the exchange rate of an order paid in another currency, for purchase history amounts. |
| `rightpress_load_multiselect_options_capabilities` | Used by other RightPress plugins. |
| `rightpress_conditions_get_coupons_start`, `rightpress_conditions_get_coupons_end` | Pricepep uses them internally to avoid a loop while cart discounts are calculated. |

### Price calculation and cart price display

| Hook | What it is for |
| --- | --- |
| `rightpress_product_price_changes_price_to_set` | Last chance to change the unit price a cart item gets. |
| `rightpress_product_price_cart_price_set` | React to price changes in the cart (Pricepep fires rp_wcdpd_product_pricing_rule_applied_to_cart from here). |
| `rightpress_product_price_cart_no_changes_to_prices` | React when no plugin changed cart prices. |
| `rightpress_product_price_cart_before_refresh_prepared_cart_item_prices` | Pricepep resets its product pricing limits here. |
| `rightpress_product_price_cart_environment_variables` | Add what else cart prices depend on, so they are prepared again when it changes (since 2.6.0). |
| `rightpress_product_price_prepare_second_stage_cart_item_price_changes` | Internal: Pricepep prepares its adjustments here. |
| `rightpress_product_price_cart_item_price_changes_first_stage_callbacks`, `rightpress_product_price_cart_item_price_changes_second_stage_callbacks` | Internal registration of price change callbacks. |
| `rightpress_product_price_cart_item_base_price_candidates` | Internal. |
| `rightpress_product_price_selected_cart_item_base_price_key` | Internal. |
| `rightpress_product_price_breakdown_average_price` | Same as rp_wcdpd_product_pricing_adjusted_price. |
| `rightpress_product_price_breakdown_prices_array_pointers` | Internal. |
| `rightpress_product_price_decimals` | Same as rp_wcdpd_decimals. |
| `rightpress_product_price_display_decimals` | Change display precision. |
| `rightpress_product_price_rounded_price` | Same as rp_wcdpd_rounded_amount. |
| `rightpress_product_price_cart_item_display_price_enabled` | Turns on the struck-through price and the price breakdown in the cart. |
| `rightpress_product_price_display_full_price` | Show or hide the struck-through full price in the cart. |
| `rightpress_product_price_cart_item_product_display_price` | Change the price HTML. |
| `rightpress_product_price_cart_item_product_display_price_breakdown_table` | Change or replace the breakdown. |
| `rightpress_product_price_cart_item_product_display_price_no_changes` | Change the price display of items without discounts. |
| `rightpress_product_price_display_price` | Change product price HTML late, after other plugins. |

### Your Price and product page price previews

| Hook | What it is for |
| --- | --- |
| `rightpress_product_price_live_update_enabled` | Turn Your Price on or off per page. |
| `rightpress_product_price_live_update_position_hook` | Use rp_wcdpd_promotion_your_price_position instead. |
| `rightpress_product_price_live_update_always_display` | Show Your Price for products without discounts. |
| `rightpress_product_price_live_update_label` | Change the label text. |
| `rightpress_product_price_live_update_label_html` | Change the label HTML. |
| `rightpress_product_price_live_update_always_display_quantity` | Show "price x quantity" even when all units cost the same. |
| `rightpress_product_price_live_update_display_subtotal` | Show or hide the subtotal under the price breakdown. |
| `rightpress_product_price_live_update_price` | Change the price Your Price shows. |
| `rightpress_product_price_live_update_extra_data` | Send extra data to your own scripts (in the response's extra_data). |
| `rightpress_product_price_live_update_test_cart_item_data`, `rightpress_product_price_test_cart_item_data` | Pass custom cart item data (for example add-on selections) so conditions like Cart item data see it. |
| `rightpress_product_price_live_update_custom_keys` | Read extra form fields into $request_data. |
| `rightpress_product_price_test_simulate_add_to_cart_extra_items` | Add companion items (for example a bundle's child items) to the simulated cart. |

### Shop prices and their cache

| Hook | What it is for |
| --- | --- |
| `rightpress_product_price_shop_change_prices_before_cart_is_loaded` | Same as rp_wcdpd_allow_price_override_before_cart_is_loaded. |
| `rightpress_product_price_shop_change_prices_in_backend` | Same as rp_wcdpd_allow_backend_price_override. |
| `rightpress_product_price_shop_skip_calculation` | Keep the WooCommerce price for some products. |
| `rightpress_product_price_shop_skip_cache`, `rightpress_product_price_shop_skip_temporary_cache` | Calculate display prices fresh. |
| `rightpress_product_price_shop_persistent_cache` | Keep calculated display prices for the current request only (or the constant `RIGHTPRESS_PRODUCT_PRICE_SHOP_PERSISTENT_CACHE`). |
| `rightpress_product_price_shop_cache_in_object_cache` | Choose between the object cache and product meta for cached display prices. |
| `rightpress_product_price_shop_cache_record_expiration_timestamp` | Expire cached display prices sooner. |
| `rightpress_product_price_shop_cache_hash_data`, `rightpress_product_price_shop_settings_hash_data`, `rightpress_product_price_shop_variable_product_prices_hash_data` | Vary cached prices by something else, for example a currency or a customer group. |
| `rightpress_product_price_shop_calculate_by_price_test` | Internal: simulate adding one unit to the cart to get the price. |
| `rightpress_product_price_shop_calculation_callbacks`, `rightpress_product_price_shop_base_price_candidates`, `rightpress_product_price_selected_shop_base_price_key` | Internal registration used by Pricepep. |

### Updates and license notices

| Hook | What it is for |
| --- | --- |
| `rightpress_updates_suppress_nags_7119279` | Hide the admin notice that asks for a license key ("Register your license key") in code. |
| `rightpress_updates_notice_emails_enabled_7119279` | Turn off, in code, the emails about Pricepep updates and licenses sent to the site administrator. |

## Where do I put this code?

Put hooks in a small custom plugin (a PHP file in `wp-content/plugins/` with a plugin header, or in `wp-content/mu-plugins/`) or in your child theme's `functions.php`. Don't edit Pricepep's files: updates replace them.

```php
<?php
/**
 * Plugin Name: My Pricepep customizations
 */

defined('ABSPATH') || exit;

// Your add_action() and add_filter() calls go here
```

## Loading

### rightpress_init

Marks the point from which Pricepep's developer functions can be used (together with WooCommerce having loaded the cart from the session).

```php
do_action( 'rightpress_init' )
```

**When it runs:** On init at priority 9.

**Source:** `rightpress/rightpress-loader.class.php:80`

```php
add_action('rightpress_init', function () {
    // RightPress library helpers are ready here
});
```

## Conditions

### rightpress_conditions_match_guest_orders_by_billing_email

Guest orders placed with the same billing email count as the customer's orders. Return false to count only orders linked to the customer account.

```php
apply_filters( 'rightpress_conditions_match_guest_orders_by_billing_email', bool $match, string $billing_email, int|null $customer_id )
```

| Parameter | Type | Description |
| --- | --- | --- |
| `$match` | bool | Default true. |
| `$billing_email` | string | Customer's billing email (account email for logged-in customers, checkout email for guests). |
| `$customer_id` | int|null | Logged-in customer ID, or 0/null for guests. |

**Returns:** bool

**When it runs:** When customer value and purchase history conditions collect the paid orders of a customer, and when the Last order and Spent - Last order conditions look up the newest paid order. The billing email matches guest orders; orders linked to a customer account count only for that account.

**Source:** `rightpress/classes/helper/rightpress-conditions.class.php:1043`, `rightpress/classes/helper/rightpress-help.class.php:3117`

```php
add_filter('rightpress_conditions_match_guest_orders_by_billing_email', '__return_false');
```

### rightpress_conditions_timeframes

Same as rp_wcdpd_timeframes; prefer the rp_wcdpd_ filter.

```php
apply_filters( 'rightpress_conditions_timeframes', array $timeframes )
```

| Parameter | Type | Description |
| --- | --- | --- |
| `$timeframes` | array | Timeframe groups (see rp_wcdpd_timeframes). |

**Returns:** array

**When it runs:** When timeframe lists are built. Pricepep passes the value through rp_wcdpd_timeframes.

**Source:** `rightpress/class-collections/conditions/rightpress-conditions-timeframes.class.php:153`

```php
add_filter('rightpress_conditions_timeframes', function ($timeframes) {
    $timeframes['days']['children']['14_day'] = array('label' => '14 days', 'value' => '-14 days');
    return $timeframes;
});
```

### rightpress_current_user_capabilities

Same as rp_wcdpd_current_user_capabilities; prefer the rp_wcdpd_ filter.

```php
apply_filters( 'rightpress_current_user_capabilities', array $capabilities )
```

| Parameter | Type | Description |
| --- | --- | --- |
| `$capabilities` | array | Capabilities of the current user. |

**Returns:** array

**When it runs:** When the User capability condition reads the current user's capabilities (before rp_wcdpd_current_user_capabilities).

**Source:** `rightpress/classes/helper/rightpress-help.class.php:191`

```php
add_filter('rightpress_current_user_capabilities', function ($capabilities) {
    return array_unique($capabilities);
});
```

### rightpress_all_user_capabilities

Add capabilities to the list (first of three filters; then rightpress_all_site_capabilities and rp_wcdpd_all_capabilities).

```php
apply_filters( 'rightpress_all_user_capabilities', array $items )
```

| Parameter | Type | Description |
| --- | --- | --- |
| `$items` | array | Capability options: each array('id', 'text'). |

**Returns:** array

**When it runs:** When the capability list for the User capability field is built.

**Source:** `rightpress/classes/helper/rightpress-conditions.class.php:235`

```php
add_filter('rightpress_all_user_capabilities', function ($items) {
    $items[] = array('id' => 'member_gold', 'text' => 'member_gold');
    return $items;
});
```

### rightpress_all_site_capabilities

Same purpose as rp_wcdpd_all_capabilities.

```php
apply_filters( 'rightpress_all_site_capabilities', array $items )
```

| Parameter | Type | Description |
| --- | --- | --- |
| `$items` | array | Capability options: each array('id', 'text'). |

**Returns:** array

**When it runs:** When the User capability field loads its options.

**Source:** `rightpress/class-collections/conditions/condition-fields/rightpress-condition-field-multiselect-capabilities.class.php:47`

```php
add_filter('rightpress_all_site_capabilities', function ($items) {
    return $items;
});
```

### rightpress_custom_condition_taxonomies

Same as rp_wcdpd_custom_condition_taxonomies.

```php
apply_filters( 'rightpress_custom_condition_taxonomies', array $taxonomies )
```

| Parameter | Type | Description |
| --- | --- | --- |
| `$taxonomies` | array | Taxonomy names offered for custom taxonomy conditions. |

**Returns:** array

**When it runs:** When custom product taxonomies are listed. Pricepep passes the value through rp_wcdpd_custom_condition_taxonomies.

**Source:** `rightpress/class-collections/conditions/rightpress-controller-conditions.class.php:617`

```php
add_filter('rightpress_custom_condition_taxonomies', function ($taxonomies) {
    return $taxonomies;
});
```

### rightpress_custom_condition_taxonomy_object_types

Same as rp_wcdpd_custom_condition_taxonomy_object_types.

```php
apply_filters( 'rightpress_custom_condition_taxonomy_object_types', array $object_types )
```

| Parameter | Type | Description |
| --- | --- | --- |
| `$object_types` | array | Default array('product', 'product_variation'). |

**Returns:** array

**When it runs:** When custom product taxonomies are listed.

**Source:** `rightpress/class-collections/conditions/rightpress-controller-conditions.class.php:608`

```php
add_filter('rightpress_custom_condition_taxonomy_object_types', function ($object_types) {
    return $object_types;
});
```

### rightpress_bundle_cart_item_filter_flags

Same as rp_wcdpd_bundle_cart_item_filter_flags.

```php
apply_filters( 'rightpress_bundle_cart_item_filter_flags', array $flags )
```

| Parameter | Type | Description |
| --- | --- | --- |
| `$flags` | array | Default array('bundled_items'). |

**Returns:** array

**When it runs:** When cart quantities, cart lines and cart weight are counted. Subtotal sums keep container lines (see rightpress_bundle_cart_items_out_of_subtotals). Pricepep passes the value through rp_wcdpd_bundle_cart_item_filter_flags.

**Source:** `rightpress/classes/helper/rightpress-help.class.php:4264`

```php
add_filter('rightpress_bundle_cart_item_filter_flags', function ($flags) {
    return $flags;
});
```

### rightpress_bundle_cart_items_out_of_subtotals

Leave bundle containers out of subtotal sums too. By default subtotal sums keep every cart line, as WooCommerce's cart subtotal does, because a bundle that isn't priced item by item carries its whole price on the container's line.

```php
apply_filters( 'rightpress_bundle_cart_items_out_of_subtotals', bool $leave_out )
```

| Parameter | Type | Description |
| --- | --- | --- |
| `$leave_out` | bool | Default false. Return true for the sums before 2.6.0, without container lines. |

**Returns:** bool

**When it runs:** When the Cart item subtotal conditions add up their lines, and when per cart item percentage discounts and fees work out the subtotal of the matching items.

**Since:** 2.6.0 · **Source:** `rightpress/class-collections/conditions/conditions/rightpress-condition-cart-item-subtotals.class.php:70`, `classes/conditions/rp-wcdpd-controller-conditions.class.php:100`

```php
add_filter('rightpress_bundle_cart_items_out_of_subtotals', '__return_true');
```

### rightpress_condition_shipping_method_all_packages

Check only the first shipping package in the Shipping method condition. By default every package counts: "in list" matches when at least one package uses a selected method, "not in list" when none does.

```php
apply_filters( 'rightpress_condition_shipping_method_all_packages', bool $all_packages, array $shipping_methods, array $params )
```

| Parameter | Type | Description |
| --- | --- | --- |
| `$all_packages` | bool | Default true. Return false to use the first package's method only, as in earlier versions. |
| `$shipping_methods` | array | Chosen shipping method of each package, such as 'flat_rate:3'. |
| `$params` | array | Condition parameters. |

**Returns:** bool

**When it runs:** When a Shipping method condition of a cart discount or checkout fee is checked.

**Since:** 2.6.0 · **Source:** `rightpress/class-collections/conditions/conditions/rightpress-condition-checkout-shipping-method.class.php:72`

```php
add_filter('rightpress_condition_shipping_method_all_packages', '__return_false');
```

### rightpress_wc_order_currency_rate

Give the exchange rate of an order paid in another currency, so purchase history amounts compare in the base currency. Pricepep knows the rates of WooCommerce Currency Switcher (WOOCS) and Aelia, which save them with the order, and of WooCommerce Multilingual, whose current rate is used.

```php
apply_filters( 'rightpress_wc_order_currency_rate', float|false $currency_rate, WC_Order $order )
```

| Parameter | Type | Description |
| --- | --- | --- |
| `$currency_rate` | float|false | Units of the order's currency per unit of the base currency, or false when the order is in the base currency or no supported currency plugin converted it. |
| `$order` | WC_Order | The order. |

**Returns:** float or false (a number of 0 or less counts as false)

**When it runs:** When the Spent - Total, Spent - Average per order, Spent - Last order and Value purchased conditions convert an order's amounts to the base currency.

**Since:** 2.6.0 · **Source:** `rightpress/classes/helper/rightpress-help.class.php:1656`

```php
// Our currency plugin saves the rate in the order meta "_my_currency_rate"
add_filter('rightpress_wc_order_currency_rate', function ($currency_rate, $order) {
    $rate = (float) $order->get_meta('_my_currency_rate');
    return $rate > 0 ? $rate : $currency_rate;
}, 10, 2);
```

### rightpress_load_multiselect_options_capabilities

Used by other RightPress plugins.

```php
apply_filters( 'rightpress_load_multiselect_options_capabilities', array $capabilities, string $prefix )
```

| Parameter | Type | Description |
| --- | --- | --- |
| `$capabilities` | array | Capabilities allowed to load option lists in the rule editor. Default array('manage_woocommerce') (Pricepep also checks its own admin capability). |
| `$prefix` | string | Plugin prefix, 'rp_wcdpd_' for Pricepep. |

**Returns:** array

**When it runs:** Pricepep does not use this check: it overrides it with its own admin capability (rp_wcdpd_capability). Listed for completeness.

**Source:** `rightpress/class-collections/conditions/rightpress-controller-conditions.class.php:378`

```php
// Not needed for Pricepep: use rp_wcdpd_capability instead
```

### rightpress_conditions_get_coupons_start / rightpress_conditions_get_coupons_end

Pricepep uses them internally to avoid a loop while cart discounts are calculated.

```php
do_action( 'rightpress_conditions_get_coupons_start' )
do_action( 'rightpress_conditions_get_coupons_end' )
```

**When it runs:** Around the moment the product condition Coupons applied reads the cart's coupons.

**Source:** `rightpress/class-collections/conditions/conditions/rightpress-condition-product-other-wc-coupons-applied.class.php:65`, `rightpress/class-collections/conditions/conditions/rightpress-condition-product-other-wc-coupons-applied.class.php:71`

```php
add_action('rightpress_conditions_get_coupons_start', function () {
    // Runs just before the Coupons applied condition reads cart coupons
});
```

## Price calculation and cart price display

### rightpress_product_price_changes_price_to_set

Last chance to change the unit price a cart item gets.

```php
apply_filters( 'rightpress_product_price_changes_price_to_set', float $price, string $cart_item_key, array $price_changes, array $cart_items )
```

| Parameter | Type | Description |
| --- | --- | --- |
| `$price` | float | Unit price worked out for the cart item (average of its units). |
| `$cart_item_key` | string | Cart item key. |
| `$price_changes` | array | Price change data of all cart items. |
| `$cart_items` | array | Cart items. |

**Returns:** float

**When it runs:** When the price of each changed cart item is decided (real cart and price tests).

**Source:** `rightpress/components/rightpress-product-price/classes/rightpress-product-price-changes.class.php:119`

```php
add_filter('rightpress_product_price_changes_price_to_set', function ($price, $cart_item_key, $price_changes, $cart_items) {
    return max(0.01, $price); // never 0.00
}, 10, 4);
```

### rightpress_product_price_cart_price_set

React to price changes in the cart (Pricepep fires rp_wcdpd_product_pricing_rule_applied_to_cart from here).

```php
do_action( 'rightpress_product_price_cart_price_set', float $price, string $cart_item_key, WC_Cart $cart, array $price_change )
```

| Parameter | Type | Description |
| --- | --- | --- |
| `$price` | float | New unit price. |
| `$cart_item_key` | string | Cart item key. |
| `$cart` | WC_Cart | Cart. |
| `$price_change` | array | Price change data of the item. |

**When it runs:** Once per distinct price change, when prepared prices are applied to the cart.

**Source:** `rightpress/components/rightpress-product-price/classes/rightpress-product-price-cart.class.php:191`

```php
add_action('rightpress_product_price_cart_price_set', function ($price, $cart_item_key, $cart, $price_change) {
    // $price_change['all_changes']['rp_wcdpd'] lists the Pricepep rules involved
}, 10, 4);
```

### rightpress_product_price_cart_no_changes_to_prices

React when no plugin changed cart prices.

```php
do_action( 'rightpress_product_price_cart_no_changes_to_prices', WC_Cart $cart )
```

| Parameter | Type | Description |
| --- | --- | --- |
| `$cart` | WC_Cart | Cart. |

**When it runs:** When prices are applied and no cart item price changes.

**Source:** `rightpress/components/rightpress-product-price/classes/rightpress-product-price-cart.class.php:205`

```php
add_action('rightpress_product_price_cart_no_changes_to_prices', function ($cart) {
    // nothing changed
});
```

### rightpress_product_price_cart_before_refresh_prepared_cart_item_prices

Pricepep resets its product pricing limits here.

```php
do_action( 'rightpress_product_price_cart_before_refresh_prepared_cart_item_prices', WC_Cart $cart )
```

| Parameter | Type | Description |
| --- | --- | --- |
| `$cart` | WC_Cart | Cart. |

**When it runs:** Before prepared cart item prices are refreshed.

**Source:** `rightpress/components/rightpress-product-price/classes/rightpress-product-price-cart.class.php:320`

```php
add_action('rightpress_product_price_cart_before_refresh_prepared_cart_item_prices', function ($cart) {
    // reset your own per-calculation state
});
```

### rightpress_product_price_cart_environment_variables

Add what else your cart prices depend on, so prices prepared earlier in a request are prepared again when it changes.

```php
apply_filters( 'rightpress_product_price_cart_environment_variables', array $variables, WC_Cart|false $cart )
```

| Parameter | Type | Description |
| --- | --- | --- |
| `$variables` | array | What the cart prices were prepared with: the applied coupons, and each cart item's key, quantity and price as set on the product. |
| `$cart` | WC_Cart|false | The cart; false where there is none, for example a product feed generated in WP-Cron (so don't type the callback's parameter as `?WC_Cart`). |

**Returns:** array

**When it runs:** Whenever cart prices are about to be prepared or reused, and for each shop price taken from the per-request price cache (every product price on a page while the shop price cache is skipped), so keep it fast. When the array differs from the one the prices were prepared with, they are prepared again. Pricepep adds the customer's shipping address here when product pricing rules have address conditions, so prices follow an address change in the checkout. Added in library 9001032 (Pricepep 2.6.0).

**Since:** 2.6.0 · **Source:** `rightpress/components/rightpress-product-price/classes/rightpress-product-price-cart.class.php:139`

```php
// Cart prices that depend on a session value set by your plugin
add_filter('rightpress_product_price_cart_environment_variables', function ($variables, $cart) {
    $variables['my_plugin_price_list'] = WC()->session ? WC()->session->get('my_plugin_price_list') : null;
    return $variables;
}, 10, 2);
```

### rightpress_product_price_prepare_second_stage_cart_item_price_changes

Internal: Pricepep prepares its adjustments here.

```php
do_action( 'rightpress_product_price_prepare_second_stage_cart_item_price_changes', array $cart_items )
```

| Parameter | Type | Description |
| --- | --- | --- |
| `$cart_items` | array | Cart items being priced (real or simulated cart). |

**When it runs:** Before the second stage of price changes (where Pricepep applies its product pricing rules).

**Source:** `rightpress/components/rightpress-product-price/classes/rightpress-product-price-changes.class.php:79`

### rightpress_product_price_cart_item_price_changes_first_stage_callbacks / rightpress_product_price_cart_item_price_changes_second_stage_callbacks

Internal registration of price change callbacks.

```php
apply_filters( 'rightpress_product_price_cart_item_price_changes_first_stage_callbacks', array $callbacks )
apply_filters( 'rightpress_product_price_cart_item_price_changes_second_stage_callbacks', array $callbacks )
```

| Parameter | Type | Description |
| --- | --- | --- |
| `$callbacks` | array | Price change callbacks keyed by plugin; Pricepep registers 'rp_wcdpd' in the second stage. |

**Returns:** array

**When it runs:** When cart item price changes are calculated.

**Source:** `rightpress/components/rightpress-product-price/classes/rightpress-product-price-changes.class.php:71`, `rightpress/components/rightpress-product-price/classes/rightpress-product-price-changes.class.php:86`

### rightpress_product_price_cart_item_base_price_candidates

Internal.

```php
apply_filters( 'rightpress_product_price_cart_item_base_price_candidates', array $candidates, WC_Product $product, string $cart_item_key, array $cart_item )
```

| Parameter | Type | Description |
| --- | --- | --- |
| `$candidates` | array | Possible base prices keyed by price key. |
| `$product` | WC_Product | Product. |
| `$cart_item_key` | string | Cart item key. |
| `$cart_item` | array | Cart item. |

**Returns:** array

**When it runs:** When the base price of a cart item is chosen. Pricepep adds the regular price as a candidate (Base price for products on sale).

**Source:** `rightpress/components/rightpress-product-price/classes/rightpress-product-price-changes.class.php:235`

### rightpress_product_price_selected_cart_item_base_price_key

Internal.

```php
apply_filters( 'rightpress_product_price_selected_cart_item_base_price_key', string $key, array $candidate_keys, string $cart_item_key )
```

| Parameter | Type | Description |
| --- | --- | --- |
| `$key` | string | Selected base price key. |
| `$candidate_keys` | array | All candidate keys. |
| `$cart_item_key` | string | Cart item key. |

**Returns:** string

**When it runs:** After base price candidates are collected.

**Source:** `rightpress/components/rightpress-product-price/classes/rightpress-product-price-changes.class.php:274`

### rightpress_product_price_breakdown_average_price

Same as rp_wcdpd_product_pricing_adjusted_price.

```php
apply_filters( 'rightpress_product_price_breakdown_average_price', float $average_price, array $price_ranges, WC_Product $product, array|null $cart_item )
```

| Parameter | Type | Description |
| --- | --- | --- |
| `$average_price` | float | Average unit price. |
| `$price_ranges` | array | Price ranges. |
| `$product` | WC_Product | Product. |
| `$cart_item` | array|null | Cart item. |

**Returns:** float

**When it runs:** When a unit price is worked out from price ranges. Pricepep passes it through rp_wcdpd_product_pricing_adjusted_price.

**Source:** `rightpress/components/rightpress-product-price/classes/rightpress-product-price-breakdown.class.php:117`

```php
add_filter('rightpress_product_price_breakdown_average_price', function ($average_price, $price_ranges, $product, $cart_item) {
    return $average_price;
}, 10, 4);
```

### rightpress_product_price_breakdown_prices_array_pointers

Internal.

```php
apply_filters( 'rightpress_product_price_breakdown_prices_array_pointers', array $pointers )
```

| Parameter | Type | Description |
| --- | --- | --- |
| `$pointers` | array | Pointer per plugin; Pricepep adds 'rp_wcdpd'. |

**Returns:** array

**When it runs:** When a prices array is created.

**Source:** `rightpress/components/rightpress-product-price/classes/rightpress-product-price-breakdown.class.php:53`

### rightpress_product_price_decimals

Same as rp_wcdpd_decimals.

```php
apply_filters( 'rightpress_product_price_decimals', int $decimals )
```

| Parameter | Type | Description |
| --- | --- | --- |
| `$decimals` | int | WooCommerce number of decimals. |

**Returns:** int

**When it runs:** Whenever a price is rounded. Pricepep passes it through rp_wcdpd_decimals.

**Source:** `rightpress/components/rightpress-product-price/rightpress-product-price.class.php:289`

```php
add_filter('rightpress_product_price_decimals', function ($decimals) {
    return $decimals;
});
```

### rightpress_product_price_display_decimals

Change display precision.

```php
apply_filters( 'rightpress_product_price_display_decimals', int $decimals )
```

| Parameter | Type | Description |
| --- | --- | --- |
| `$decimals` | int | Decimals used to compare prices for display. |

**Returns:** int

**When it runs:** When prices are compared for display (price breakdown rows).

**Source:** `rightpress/components/rightpress-product-price/rightpress-product-price.class.php:302`

```php
add_filter('rightpress_product_price_display_decimals', function ($decimals) {
    return 2;
});
```

### rightpress_product_price_rounded_price

Same as rp_wcdpd_rounded_amount.

```php
apply_filters( 'rightpress_product_price_rounded_price', float $rounded_price, float $price, int $decimals )
```

| Parameter | Type | Description |
| --- | --- | --- |
| `$rounded_price` | float | Rounded price. |
| `$price` | float | Unrounded price. |
| `$decimals` | int | Decimals. |

**Returns:** float

**When it runs:** Whenever a price is rounded. Pricepep passes it through rp_wcdpd_rounded_amount.

**Source:** `rightpress/components/rightpress-product-price/rightpress-product-price.class.php:272`

```php
add_filter('rightpress_product_price_rounded_price', function ($rounded_price, $price, $decimals) {
    return $rounded_price;
}, 10, 3);
```

### rightpress_product_price_cart_item_display_price_enabled

Turns on the struck-through price and the price breakdown in the cart. Return false to keep the WooCommerce display.

```php
apply_filters( 'rightpress_product_price_cart_item_display_price_enabled', bool $enabled )
```

| Parameter | Type | Description |
| --- | --- | --- |
| `$enabled` | bool | Default false; Pricepep returns true. |

**Returns:** bool

**When it runs:** When WooCommerce prints a cart item price and subtotal.

**Source:** `rightpress/components/rightpress-product-price/classes/rightpress-product-price-display.class.php:125`, `rightpress/components/rightpress-product-price/classes/rightpress-product-price-display.class.php:374`

```php
// Use WooCommerce's plain cart price display
add_filter('rightpress_product_price_cart_item_display_price_enabled', '__return_false', 20);
```

### rightpress_product_price_display_full_price

Show or hide the struck-through full price in the cart.

```php
apply_filters( 'rightpress_product_price_display_full_price', bool $display, float $full_price, float $price, array|null $cart_item )
```

| Parameter | Type | Description |
| --- | --- | --- |
| `$display` | bool | Default false; true when Display regular price when discounting is on. |
| `$full_price` | float | Price before discounts. |
| `$price` | float | Discounted price. |
| `$cart_item` | array|null | Cart item. |

**Returns:** bool

**When it runs:** For each price row of a discounted cart item.

**Source:** `rightpress/components/rightpress-product-price/classes/rightpress-product-price-display.class.php:211`

```php
// Show the old price only when the saving is at least 10%
add_filter('rightpress_product_price_display_full_price', function ($display, $full_price, $price, $cart_item) {
    return $display && $full_price > 0 && ($full_price - $price) / $full_price >= 0.10;
}, 60, 4);
```

### rightpress_product_price_cart_item_product_display_price

Change the price HTML.

```php
apply_filters( 'rightpress_product_price_cart_item_product_display_price', string $formatted_price, array $entry, float $full_price, WC_Product $product, array|null $cart_item )
```

| Parameter | Type | Description |
| --- | --- | --- |
| `$formatted_price` | string | Price HTML of one price row (with `<del>`/`<ins>` when discounted). |
| `$entry` | array | Price row: 'price', 'full_price', 'quantity'. |
| `$full_price` | float | Full price for display. |
| `$product` | WC_Product | Product. |
| `$cart_item` | array|null | Cart item. |

**Returns:** string

**When it runs:** When the cart item price (and Your Price) is formatted. Pricepep adds the public description tooltip here.

**Source:** `rightpress/components/rightpress-product-price/classes/rightpress-product-price-display.class.php:217`

```php
add_filter('rightpress_product_price_cart_item_product_display_price', function ($formatted_price, $entry, $full_price, $product, $cart_item) {
    return $formatted_price . ' <small>' . esc_html__('each', 'my-textdomain') . '</small>';
}, 60, 5);
```

### rightpress_product_price_cart_item_product_display_price_breakdown_table

Change or replace the breakdown.

```php
apply_filters( 'rightpress_product_price_cart_item_product_display_price_breakdown_table', string $table_html, array $price_breakdown, WC_Product $product, array|null $cart_item )
```

| Parameter | Type | Description |
| --- | --- | --- |
| `$table_html` | string | Price breakdown HTML (one row per price, with quantities). |
| `$price_breakdown` | array | Rows. |
| `$product` | WC_Product | Product. |
| `$cart_item` | array|null | Cart item. |

**Returns:** string

**When it runs:** When a cart item has units at different prices (tiered, buy x get y...).

**Source:** `rightpress/components/rightpress-product-price/classes/rightpress-product-price-display.class.php:252`

```php
add_filter('rightpress_product_price_cart_item_product_display_price_breakdown_table', function ($table_html, $price_breakdown, $product, $cart_item) {
    return '<div class="my-breakdown">' . $table_html . '</div>';
}, 10, 4);
```

### rightpress_product_price_cart_item_product_display_price_no_changes

Change the price display of items without discounts.

```php
apply_filters( 'rightpress_product_price_cart_item_product_display_price_no_changes', string $display_price, array $cart_item, string $cart_item_key )
```

| Parameter | Type | Description |
| --- | --- | --- |
| `$display_price` | string | WooCommerce price HTML. |
| `$cart_item` | array | Cart item. |
| `$cart_item_key` | string | Cart item key. |

**Returns:** string

**When it runs:** When a cart item price is printed and no price change applies to it.

**Source:** `rightpress/components/rightpress-product-price/classes/rightpress-product-price-display.class.php:141`

```php
add_filter('rightpress_product_price_cart_item_product_display_price_no_changes', function ($display_price, $cart_item, $cart_item_key) {
    return $display_price;
}, 10, 3);
```

### rightpress_product_price_display_price

Change product price HTML late, after other plugins.

```php
apply_filters( 'rightpress_product_price_display_price', string $display_price, WC_Product $product, string $current_filter )
```

| Parameter | Type | Description |
| --- | --- | --- |
| `$display_price` | string | Product price HTML. |
| `$product` | WC_Product | Product. |
| `$current_filter` | string | WooCommerce filter that produced it, such as woocommerce_get_price_html. |

**Returns:** string

**When it runs:** On WooCommerce price HTML filters, only if a callback was added before the display class loads (before init priority 20). Pricepep does not use it.

**Source:** `rightpress/components/rightpress-product-price/classes/rightpress-product-price-display.class.php:109`

```php
add_action('plugins_loaded', function () {
    add_filter('rightpress_product_price_display_price', function ($display_price, $product, $current_filter) {
        return $display_price;
    }, 10, 3);
});
```

## Your Price and product page price previews

### rightpress_product_price_live_update_enabled

Turn Your Price on or off per page.

```php
apply_filters( 'rightpress_product_price_live_update_enabled', bool $enabled )
```

| Parameter | Type | Description |
| --- | --- | --- |
| `$enabled` | bool | Default false; true when the Your Price tool is on. |

**Returns:** bool

**When it runs:** When the product page prints the Your Price container.

**Source:** `rightpress/components/rightpress-product-price/classes/rightpress-product-price-live-update.class.php:86`

```php
add_filter('rightpress_product_price_live_update_enabled', function ($enabled) {
    return is_product() && has_term('no-live-price', 'product_tag') ? false : $enabled;
}, 20);
```

### rightpress_product_price_live_update_position_hook

Use rp_wcdpd_promotion_your_price_position instead.

```php
apply_filters( 'rightpress_product_price_live_update_position_hook', string $hook )
```

| Parameter | Type | Description |
| --- | --- | --- |
| `$hook` | string | Default woocommerce_before_add_to_cart_button; Pricepep returns the Position on page setting. |

**Returns:** string

**When it runs:** On init (priority 999).

**Source:** `rightpress/components/rightpress-product-price/classes/rightpress-product-price-live-update.class.php:73`

```php
// Prefer rp_wcdpd_promotion_your_price_position
```

### rightpress_product_price_live_update_always_display

Show Your Price for products without discounts.

```php
apply_filters( 'rightpress_product_price_live_update_always_display', bool $always, WC_Product $product )
```

| Parameter | Type | Description |
| --- | --- | --- |
| `$always` | bool | Default false; true when Display when product is not discounted is on or the main price is replaced. |
| `$product` | WC_Product | Product. |

**Returns:** bool

**When it runs:** In the Ajax request that updates Your Price.

**Source:** `rightpress/components/rightpress-product-price/classes/rightpress-product-price-live-update.class.php:157`

```php
add_filter('rightpress_product_price_live_update_always_display', function ($always, $product) {
    return $product->is_type('variable') ? true : $always;
}, 20, 2);
```

### rightpress_product_price_live_update_label

Change the label text.

```php
apply_filters( 'rightpress_product_price_live_update_label', string $label, WC_Product $product, array $price_data )
```

| Parameter | Type | Description |
| --- | --- | --- |
| `$label` | string | Default 'Price'; Pricepep returns the Label setting (Your Price:). |
| `$product` | WC_Product | Product. |
| `$price_data` | array | Price test result. |

**Returns:** string

**When it runs:** In the Ajax request that updates Your Price.

**Source:** `rightpress/components/rightpress-product-price/classes/rightpress-product-price-live-update.class.php:184`

```php
add_filter('rightpress_product_price_live_update_label', function ($label, $product, $price_data) {
    return __('Your price today:', 'my-textdomain');
}, 60, 3);
```

### rightpress_product_price_live_update_label_html

Change the label HTML.

```php
apply_filters( 'rightpress_product_price_live_update_label_html', string $label_html, WC_Product $product, array $price_data )
```

| Parameter | Type | Description |
| --- | --- | --- |
| `$label_html` | string | Label HTML. |
| `$product` | WC_Product | Product. |
| `$price_data` | array | Price test result. |

**Returns:** string

**When it runs:** Right after the label text filter.

**Source:** `rightpress/components/rightpress-product-price/classes/rightpress-product-price-live-update.class.php:185`

> Replaces rightpress_live_product_price_update_label_html from older versions, which no longer runs.

```php
add_filter('rightpress_product_price_live_update_label_html', function ($label_html, $product, $price_data) {
    return '<strong>' . $label_html . '</strong>';
}, 10, 3);
```

### rightpress_product_price_live_update_always_display_quantity

Show "price x quantity" even when all units cost the same.

```php
apply_filters( 'rightpress_product_price_live_update_always_display_quantity', bool $always, WC_Product $product, array $price_data )
```

| Parameter | Type | Description |
| --- | --- | --- |
| `$always` | bool | Default false; Pricepep returns the Display quantity next to price setting. |
| `$product` | WC_Product | Product. |
| `$price_data` | array | Price test result. |

**Returns:** bool

**When it runs:** In the Your Price Ajax request.

**Source:** `rightpress/components/rightpress-product-price/classes/rightpress-product-price-live-update.class.php:188`

```php
add_filter('rightpress_product_price_live_update_always_display_quantity', '__return_true', 20);
```

### rightpress_product_price_live_update_display_subtotal

Show or hide the subtotal under the price breakdown.

```php
apply_filters( 'rightpress_product_price_live_update_display_subtotal', bool $display, WC_Product $product, array $price_data )
```

| Parameter | Type | Description |
| --- | --- | --- |
| `$display` | bool | Default true; Pricepep returns the Display subtotal when displaying quantity setting. |
| `$product` | WC_Product | Product. |
| `$price_data` | array | Price test result. |

**Returns:** bool

**When it runs:** In the Your Price Ajax request.

**Source:** `rightpress/components/rightpress-product-price/classes/rightpress-product-price-live-update.class.php:191`

```php
add_filter('rightpress_product_price_live_update_display_subtotal', '__return_false', 20);
```

### rightpress_product_price_live_update_price

Change the price Your Price shows.

```php
apply_filters( 'rightpress_product_price_live_update_price', float $price, WC_Product $product )
```

| Parameter | Type | Description |
| --- | --- | --- |
| `$price` | float | Price from the price test after woocommerce_product_get_price. |
| `$product` | WC_Product | Product. |

**Returns:** float

**When it runs:** In the Your Price Ajax request.

**Source:** `rightpress/components/rightpress-product-price/classes/rightpress-product-price-live-update.class.php:197`

```php
add_filter('rightpress_product_price_live_update_price', function ($price, $product) {
    return $price;
}, 10, 2);
```

### rightpress_product_price_live_update_extra_data

Send extra data to your own scripts (in the response's extra_data).

```php
apply_filters( 'rightpress_product_price_live_update_extra_data', array $extra_data )
```

| Parameter | Type | Description |
| --- | --- | --- |
| `$extra_data` | array | Default empty array. |

**Returns:** array

**When it runs:** In the Your Price Ajax response.

**Source:** `rightpress/components/rightpress-product-price/classes/rightpress-product-price-live-update.class.php:208`

> Replaces rightpress_live_product_price_update_extra_data from older versions.

```php
add_filter('rightpress_product_price_live_update_extra_data', function ($extra_data) {
    $extra_data['my_message'] = __('Free shipping over 50', 'my-textdomain');
    return $extra_data;
});
```

### rightpress_product_price_live_update_test_cart_item_data / rightpress_product_price_test_cart_item_data

Pass custom cart item data (for example add-on selections) so conditions like Cart item data see it.

```php
apply_filters( 'rightpress_product_price_live_update_test_cart_item_data', array $cart_item_data, WC_Product $product, array $request_data )
apply_filters( 'rightpress_product_price_test_cart_item_data', array $cart_item_data, WC_Product $product, array $request_data )
```

| Parameter | Type | Description |
| --- | --- | --- |
| `$cart_item_data` | array | Cart item data used for the simulated add to cart. |
| `$product` | WC_Product | Product. |
| `$request_data` | array | Product form data sent by the page. |

**Returns:** array

**When it runs:** Before a price test simulates adding the product to the cart (Your Price; the test version also for banners and the countdown).

**Source:** `rightpress/components/rightpress-product-price/classes/rightpress-product-price-live-update.class.php:154`, `rightpress/components/rightpress-product-price/classes/rightpress-product-price-test.class.php:392`

```php
add_filter('rightpress_product_price_test_cart_item_data', function ($cart_item_data, $product, $request_data) {
    if (!empty($request_data['my_engraving'])) {
        $cart_item_data['my_engraving'] = sanitize_text_field($request_data['my_engraving']);
    }
    return $cart_item_data;
}, 10, 3);
```

### rightpress_product_price_live_update_custom_keys

Read extra form fields into $request_data.

```php
apply_filters( 'rightpress_product_price_live_update_custom_keys', array $keys )
```

| Parameter | Type | Description |
| --- | --- | --- |
| `$keys` | array | Request keys read from the product form. Default array('rightpress_complete_input_list'). |

**Returns:** array

**When it runs:** When the product page Ajax tools (Your Price, banners, countdown, variation tables) read the request.

**Source:** `rightpress/components/rightpress-product-price/rightpress-product-price.class.php:517`

```php
add_filter('rightpress_product_price_live_update_custom_keys', function ($keys) {
    $keys[] = 'my_engraving';
    return $keys;
});
```

### rightpress_product_price_test_simulate_add_to_cart_extra_items

Add companion items (for example a bundle's child items) to the simulated cart.

```php
apply_filters( 'rightpress_product_price_test_simulate_add_to_cart_extra_items', array $extra_items, int $product_id, int $variation_id, array $cart_item_data, int $quantity )
```

| Parameter | Type | Description |
| --- | --- | --- |
| `$extra_items` | array | Extra items to add to the simulated cart. Default empty. |
| `$product_id` | int | Product ID. |
| `$variation_id` | int | Variation ID. |
| `$cart_item_data` | array | Cart item data. |
| `$quantity` | int | Quantity. |

**Returns:** array

**When it runs:** When a price test simulates adding a product to the cart.

**Source:** `rightpress/components/rightpress-product-price/classes/rightpress-product-price-test.class.php:156`

## Shop prices and their cache

### rightpress_product_price_shop_change_prices_before_cart_is_loaded

Same as rp_wcdpd_allow_price_override_before_cart_is_loaded.

```php
apply_filters( 'rightpress_product_price_shop_change_prices_before_cart_is_loaded', bool $allow )
```

| Parameter | Type | Description |
| --- | --- | --- |
| `$allow` | bool | Default false. |

**Returns:** bool

**When it runs:** When a shop price is read before the cart is loaded. Pricepep passes it through rp_wcdpd_allow_price_override_before_cart_is_loaded.

**Source:** `rightpress/components/rightpress-product-price/classes/rightpress-product-price-shop.class.php:130`

```php
add_filter('rightpress_product_price_shop_change_prices_before_cart_is_loaded', '__return_true');
```

### rightpress_product_price_shop_change_prices_in_backend

Same as rp_wcdpd_allow_backend_price_override.

```php
apply_filters( 'rightpress_product_price_shop_change_prices_in_backend', bool $allow, mixed $price, string $price_type, WC_Product $product )
```

| Parameter | Type | Description |
| --- | --- | --- |
| `$allow` | bool | Default false. |
| `$price` | mixed | Price. |
| `$price_type` | string | 'price', 'regular_price' or 'sale_price'. |
| `$product` | WC_Product | Product. |

**Returns:** bool

**When it runs:** When a shop price is read outside storefront requests. Pricepep passes it through rp_wcdpd_allow_backend_price_override.

**Source:** `rightpress/components/rightpress-product-price/classes/rightpress-product-price-shop.class.php:140`

```php
add_filter('rightpress_product_price_shop_change_prices_in_backend', function ($allow, $price, $price_type, $product) {
    return $allow;
}, 10, 4);
```

### rightpress_product_price_shop_skip_calculation

Keep the WooCommerce price for some products.

```php
apply_filters( 'rightpress_product_price_shop_skip_calculation', bool $skip, mixed $price, string $price_type, WC_Product $product )
```

| Parameter | Type | Description |
| --- | --- | --- |
| `$skip` | bool | Default false. |
| `$price` | mixed | Price. |
| `$price_type` | string | Price type. |
| `$product` | WC_Product | Product. |

**Returns:** bool

**When it runs:** Before a display price is calculated.

**Source:** `rightpress/components/rightpress-product-price/classes/rightpress-product-price-shop.class.php:540`

```php
// Never change the displayed price of the gift card product
add_filter('rightpress_product_price_shop_skip_calculation', function ($skip, $price, $price_type, $product) {
    return $product->get_id() === 123 ? true : $skip;
}, 10, 4);
```

### rightpress_product_price_shop_skip_cache / rightpress_product_price_shop_skip_temporary_cache

Calculate display prices fresh.

```php
apply_filters( 'rightpress_product_price_shop_skip_cache', bool $skip, WC_Product $product )
apply_filters( 'rightpress_product_price_shop_skip_temporary_cache', bool $skip, WC_Product $product )
```

| Parameter | Type | Description |
| --- | --- | --- |
| `$skip` | bool | Default false. Pricepep skips the stored cache when product pricing rules have customer, order history or purchase history conditions and the customer is logged in; order history or purchase history conditions and a guest's billing email is known (checkout and Store API requests); shipping address conditions (for every visitor, cart empty or not); cart conditions and the cart is not empty. With **Change - Include all adjustment types**, items in the cart and a Bulk pricing, Tiered pricing, Group of products, Buy x get x or Buy x get y rule, it skips it since 2.6.0 only for the products such rules can price (see `rp_wcdpd_shop_price_cache_per_product` in the [filter reference](/docs/filter-reference/)), and for every product when a rule has **Other** product conditions or **Total limit** is a **Total discount limit**. The stored cache is also skipped when it is turned off (rightpress_product_price_shop_persistent_cache). |
| `$product` | WC_Product | Product. |

**Returns:** bool

**When it runs:** Before a display price is read from the cache.

**Source:** `rightpress/components/rightpress-product-price/classes/rightpress-product-price-shop.class.php:246`, `rightpress/components/rightpress-product-price/classes/rightpress-product-price-shop.class.php:295`

```php
add_filter('rightpress_product_price_shop_skip_cache', function ($skip, $product) {
    return is_user_logged_in() ? true : $skip;
}, 60, 2);
```

### rightpress_product_price_shop_persistent_cache / RIGHTPRESS_PRODUCT_PRICE_SHOP_PERSISTENT_CACHE

Keep calculated display prices for the current request only. By default they are kept across requests, in product meta or in a persistent object cache (see rightpress_product_price_shop_cache_in_object_cache); turned off, nothing is read or written there and prices are calculated on each page view, which costs more time per page.

```php
apply_filters( 'rightpress_product_price_shop_persistent_cache', bool $enabled )
```

| Parameter | Type | Description |
| --- | --- | --- |
| `$enabled` | bool | Default true, or false when the constant `RIGHTPRESS_PRODUCT_PRICE_SHOP_PERSISTENT_CACHE` is defined as false. |

**Returns:** bool

**When it runs:** Before a display price is read from or written to the stored cache.

**Since:** 2.6.0 · **Source:** `rightpress/components/rightpress-product-price/classes/rightpress-product-price-shop.class.php:264`, `rightpress/components/rightpress-product-price/classes/rightpress-product-price-shop.class.php:262`

```php
// In wp-config.php, above "That's all, stop editing!"
define('RIGHTPRESS_PRODUCT_PRICE_SHOP_PERSISTENT_CACHE', false);

// Or in a plugin
add_filter('rightpress_product_price_shop_persistent_cache', '__return_false');
```

### rightpress_product_price_shop_cache_in_object_cache

Choose where calculated display prices are kept. With a persistent object cache (Redis, Memcached and similar) they go there, in the group rightpress_prices for up to 7 days, and visitors' page views write nothing to the database; otherwise they are kept in product meta (_rightpress_prices).

```php
apply_filters( 'rightpress_product_price_shop_cache_in_object_cache', bool $use_object_cache )
```

| Parameter | Type | Description |
| --- | --- | --- |
| `$use_object_cache` | bool | Default: whether WordPress uses a persistent object cache (wp_using_ext_object_cache()). |

**Returns:** bool

**When it runs:** When a display price is read from or written to the stored cache.

**Since:** 2.6.0 · **Source:** `rightpress/components/rightpress-product-price/classes/rightpress-product-price-shop.class.php:279`

```php
// Keep display prices in product meta even with an object cache
add_filter('rightpress_product_price_shop_cache_in_object_cache', '__return_false');
```

### rightpress_product_price_shop_cache_record_expiration_timestamp

Expire cached display prices sooner.

```php
apply_filters( 'rightpress_product_price_shop_cache_record_expiration_timestamp', int $timestamp, float $price, string $price_type, WC_Product $product, string $price_hash )
```

| Parameter | Type | Description |
| --- | --- | --- |
| `$timestamp` | int | When the cached price expires: now + 7 days, or earlier when a Date & Time condition of a rule changes (Pricepep). |
| `$price` | float | Price. |
| `$price_type` | string | Price type. |
| `$product` | WC_Product | Product. |
| `$price_hash` | string | Cache key. |

**Returns:** int

**When it runs:** When a display price is stored in the cache (product meta _rightpress_prices, or the object cache group rightpress_prices when the site has a persistent object cache).

**Source:** `rightpress/components/rightpress-product-price/classes/rightpress-product-price-shop.class.php:844`

```php
add_filter('rightpress_product_price_shop_cache_record_expiration_timestamp', function ($timestamp, $price, $price_type, $product, $price_hash) {
    return min($timestamp, time() + DAY_IN_SECONDS);
}, 60, 5);
```

### rightpress_product_price_shop_cache_hash_data / rightpress_product_price_shop_settings_hash_data / rightpress_product_price_shop_variable_product_prices_hash_data

Vary cached prices by something else, for example a currency or a customer group.

```php
apply_filters( 'rightpress_product_price_shop_cache_hash_data', array $hash_data )
apply_filters( 'rightpress_product_price_shop_settings_hash_data', array $hash_data )
apply_filters( 'rightpress_product_price_shop_variable_product_prices_hash_data', array $hash_data )
```

| Parameter | Type | Description |
| --- | --- | --- |
| `$hash_data` | array | Data the cache key is built from (Pricepep adds its rules and settings, and product condition values). |
| `...` | mixed | Price, price type and product (cache hash data); null (settings hash data); product (variable product prices hash data). |

**Returns:** array

**When it runs:** When the cache key of display prices is built.

**Source:** `rightpress/components/rightpress-product-price/classes/rightpress-product-price-shop.class.php:1111`, `rightpress/components/rightpress-product-price/classes/rightpress-product-price-shop.class.php:1073`, `rightpress/components/rightpress-product-price/classes/rightpress-product-price-shop.class.php:1154`

```php
// Separate cached display prices per customer group stored in a cookie
add_filter('rightpress_product_price_shop_cache_hash_data', function ($hash_data, $price, $price_type, $product) {
    $hash_data['my_group'] = isset($_COOKIE['my_group']) ? sanitize_key($_COOKIE['my_group']) : '';
    return $hash_data;
}, 10, 4);
```

### rightpress_product_price_shop_calculate_by_price_test

Internal: simulate adding one unit to the cart to get the price.

```php
apply_filters( 'rightpress_product_price_shop_calculate_by_price_test', bool $by_test, mixed $price, string $price_type, WC_Product $product )
```

| Parameter | Type | Description |
| --- | --- | --- |
| `$by_test` | bool | Default false; Pricepep returns true for Change - Include all adjustment types. |
| `$price` | mixed | Price. |
| `$price_type` | string | Price type. |
| `$product` | WC_Product | Product. |

**Returns:** bool

**When it runs:** When a display price is calculated.

**Source:** `rightpress/components/rightpress-product-price/classes/rightpress-product-price-shop.class.php:549`

### rightpress_product_price_shop_calculation_callbacks / rightpress_product_price_shop_base_price_candidates / rightpress_product_price_selected_shop_base_price_key

Internal registration used by Pricepep.

```php
apply_filters( 'rightpress_product_price_shop_calculation_callbacks', array|string $value )
apply_filters( 'rightpress_product_price_shop_base_price_candidates', array|string $value )
apply_filters( 'rightpress_product_price_selected_shop_base_price_key', array|string $value )
```

| Parameter | Type | Description |
| --- | --- | --- |
| `$value` | array|string | Callbacks, base price candidates or the selected base price key. |

**Returns:** array or string

**When it runs:** When display prices are calculated.

**Source:** `rightpress/components/rightpress-product-price/classes/rightpress-product-price-shop.class.php:613`, `rightpress/components/rightpress-product-price/classes/rightpress-product-price-shop.class.php:678`, `rightpress/components/rightpress-product-price/classes/rightpress-product-price-shop.class.php:710`

## Updates and license notices

### rightpress_updates_suppress_nags_7119279

Hide the admin notice that asks for a license key ("Register your license key") in code.

```php
apply_filters( 'rightpress_updates_suppress_nags_7119279', bool $suppress )
```

| Parameter | Type | Description |
| --- | --- | --- |
| `$suppress` | bool | Default false. |

**Returns:** bool

**When it runs:** When the admin notice asking to register the purchase code or license key would show.

**Source:** `rightpress-updates/rightpress-updates.class.php:636`

```php
add_filter('rightpress_updates_suppress_nags_7119279', '__return_true');
```

### rightpress_updates_notice_emails_enabled_7119279

Turn off, in code, the emails about Pricepep updates and licenses sent to the site administrator.

```php
apply_filters( 'rightpress_updates_notice_emails_enabled_7119279', bool $enabled )
```

| Parameter | Type | Description |
| --- | --- | --- |
| `$enabled` | bool | Default true. |

**Returns:** bool

**When it runs:** Before an email about Pricepep updates or licenses is sent to the site administrator (at most once every 30 days).

**Source:** `rightpress-updates/rightpress-updates.class.php:1327`

```php
add_filter('rightpress_updates_notice_emails_enabled_7119279', '__return_false');
```

## Internal library hooks

These run but are internal helpers; changing them is not supported:

- `rightpress_datetime_date_format`: Date format used by the library's date helper (default: WooCommerce date format). Source: `rightpress/classes/utility/rightpress-datetime.class.php:179`.
- `rightpress_datetime_datetime_format`: Date and time format used by the library's date helper. Source: `rightpress/classes/utility/rightpress-datetime.class.php:217`.
- `rightpress_datetime_time_format`: Time format used by the library's date helper. Source: `rightpress/classes/utility/rightpress-datetime.class.php:195`.
- `rightpress_early_hook_priority`: Priority the library uses for "run first" callbacks (default PHP_INT_MIN + modifier). Source: `rightpress/classes/helper/rightpress-help.class.php:4372`.
- `rightpress_late_hook_priority`: Priority the library uses for "run last" callbacks (default PHP_INT_MAX + modifier). Source: `rightpress/classes/helper/rightpress-help.class.php:4387`.
- `rightpress_testing_mode_day_override`: Testing helper; not for production. Source: `rightpress/classes/utility/rightpress-time.class.php:438`.
- `rightpress_time_periods`: Time periods the library knows (day, week, month, year). Source: `rightpress/classes/utility/rightpress-time.class.php:87`.

Not running in Pricepep 2.6: the old `rightpress_live_product_price_update_*` filters (use `rightpress_product_price_live_update_*`).

## Frequently asked questions

### Should I use rightpress_ or rp_wcdpd_ hooks?

Use rp_wcdpd_ hooks when one exists for what you need. rightpress_ hooks are shared by the library and also run for other RightPress plugins on the same site.

### How do I stop shop prices from being cached?

To keep calculated shop prices for the current request only, define RIGHTPRESS_PRODUCT_PRICE_SHOP_PERSISTENT_CACHE as false in wp-config.php or return false from rightpress_product_price_shop_persistent_cache. To skip the cache for some products or visitors, return true from rightpress_product_price_shop_skip_cache (and rightpress_product_price_shop_skip_temporary_cache).

### How do I hide the license key notice in code?

Return true from the rightpress_updates_suppress_nags_7119279 filter on that site.

## Related articles

- [Pricepep filter reference: all apply_filters hooks](https://pricepep.com/docs/filter-reference/)
- [Pricepep action reference: all do_action hooks](https://pricepep.com/docs/action-reference/)
- [Pricepep function reference for developers](https://pricepep.com/docs/function-reference/)

All articles in [Developers](https://pricepep.com/docs-category/developers/)
