Skip to content

How to dynamically change the price of the review for particular posts ​

To change the price of the review for particular posts, add this following snippet to the functions.php file of your theme or your child theme.

add_filter('wppr_price_raw', 'custom_wppr_price_raw', 10, 3);

function custom_wppr_price_raw($price, $id, $model){
	if($id == 9) {
		$price = '$ 9.99';
	}
	if($id == 10) {
		$price = '$ 19.99';
	}
	return $price;
}

This will change the price of the reviews for posts with id 9, and 10.

Was this helpful?