Searching CPT Tickets related field in form front end
-
Hi, my apologies if I’ve not been able to find an instance of this having arisen before, I found some similar questions but nothing quite the same that I could use to get to a solution…
To explain what I’m trying to do with pods just for context, I’m using WCMP plugin (Woocommerce Market Place Multivendor, it runs with Woocommerce), and I’ve added a tab in the vendor dashboard for product vendors to select and display other users of a certain role type on their (CPT) ticket.
I’ve successfully added the facility for my vendors to choose data for other fields here, which have been created using pods, and displayed them in the ticket, such as to and from dates and image uploads… so I think somewhere along the line I’m perhaps just completely misunderstanding how to use relationships with pods.
So far, I’ve extended the CPT ‘ticket’ (products, renamed) with a field called whats_onz and made this a relationship field type, relating to users.
In Relationship Options for that field, selection type is multi select as I’d like a vendor to choose multiple other users to display on their product.
I’ve chosen list view so that I can display the avatar (guessing that’s what’s meant by icon?)
In Display Field in Selection List I’ve got {@user_nicename}
So what I’m trying to achieve, is a multi-select box in the dashboard where users can choose from a list of users, and they will all appear listed on their ticket with an avatar and their username.
Here’s the wcmp code just for getting the tab content up there, which all works fine as usual, but I need to find what I should be including in here to create that relationship pods multi select form.
I’ve looked through the documentation and support but I can’t seem to work it out, here’s the code –<?php function add_custom_product_data_contents( $pro_class_obj, $product, $post ) { //prnt_r($product->get_id());die; $hh = get_post_meta($product->get_id() , 'whats_onz' ); //print_r($hh); ?> <div role="tabpanel" class="tab-pane fade" id="see-more"> <!-- just make sure tabpanel id should replace with your added tab target --> <div class="row-padding"> //what should I do here to search for users? <div class="form-group"> <label class="control-label col-sm-3 col-md-3">More:</label> <div class="col-mzd-6 col-sm-9"> <input type="search" name="whats_onz" class="form-control" value= <?php print_r($hh[0]) ?> /> </div> </div> </div> </div> <?php } add_action( 'wcmp_product_tabs_content', 'add_custom_product_data_contents', 10, 3 );
Thanks so much for any help,
Kind regards
- The topic ‘Searching CPT Tickets related field in form front end’ is closed to new replies.