I am trying to set up custom filtering of the reviews widget in Elementor. Basically what ‘d like to do is add a new ACF field for product model, and then have my loop carousel template populate with the relevant reviews (e.g. reviews with that product tag) on pages dynamically. How would I go about doing this?
I’ve added a new field but can’t figure out how to get around manually adding/inserting all of these reviews depending on the page.
here’s the code i’ve tried so dar:
add_action('elementor/query/custom_review_filter', function($query) {
if (is_page() && get_field('product_model')) {
$product_model = get_field('product_model');
$query->set('meta_key', 'product_model');
$query->set('meta_value', $product_model);
}
});