Tell us what you are trying to do?
Hello, I have a wpv-view that I'm using on multiple pages. Throughout my site have a CPT called home plans (properties) with a taxonomy of community. On this view I have properties show based on the current page archive. So If I'm on a certain community, the only properties that will be pulled are the ones in that community. These properties also have a pricing field that changes based on their community. So I have a repeater field that handles this. The repeater values are a tax object and a text field (to list the price). I need to be able filter a repeatable field inside a select box. So pretty much this. Grab Properties in archived community -> grab that property's pricing repeater -> loop through and compare the tax object with the current archive name. If they match print out the pricing value in that row into the select box. I have already done something similar with this shortcode I created.
// Pull Each Price Per Community
add_shortcode('ts_com_price', 'ts_com_price_func');
function ts_com_price_func( $atts, $content) {
$cont = do_shortcode($content);
$obj = get_queried_object();
if(have_rows('price_per_community')) :
while(have_rows('price_per_community')) : the_row();
$com = get_sub_field('community');
if($com->name == $obj->name) :
$price = get_sub_field('price');
endif;
endwhile;
endif;
// var_dump($price);
return $price;
}
Is there a way I could take that $price field and call it into the wpv-postmeta?
Like this:
<div class="form-group">
<!-- <label for="wpv-starting_price">[wpml-string context="wpv-views"]starting_price[/wpml-string]</label> -->
[wpv-control-postmeta field="$price" default_label="Price" type="select" url_param="wpv-wpcf-ts-com-price"]
</div>
or instead of field use the display_values?
Is there any documentation that you are following?
Is there a similar example that we can see?
What is the link to your site?
hidden link
Hello,
Are we talking about a custom repeating field "Price" or a repeatable field groups?
https://toolset.com/course-lesson/creating-and-displaying-repeatable-field-groups/
In your case, in order to achieve this:
These properties also have a pricing field that changes based on their community
It needs to setup connection between "Price" field and "community" taxonomy, so you might consider to setup a child post type, for example: add a custom post type "properties price", setup one-to-many relationship between "properties" and "properties price", in the child post type ""properties price", setup:
- a custom field "price"
- taxonomy "community"
So in the single "property" post, you can setup a post view:
- Query child "properties price" posts
- Filter by:
a) the post type relationship between post types ""properties" and "properties price"
https://toolset.com/course-lesson/displaying-related-posts/#displaying-many-related-items
b) Select posts with taxonomy:
"community" the same as the current archive page
https://toolset.com/documentation/user-guides/views/filtering-views-by-taxonomy/
- In view's loop, display the "Price" field value