I have read this page for guidance and the below forum post along with others:
https://toolset.com/documentation/user-guides/cred-forms-for-child-content/
https://toolset.com/forums/topic/how-to-get-rating-average-from-cred-for-review/
. . .
I am trying to: create a review component to the website here: hidden link
I've create a new custom post type vendor-review (singular) and it is a 'child' of the parent custom post type vendor. Vendor review has several custom fields to display of which one is a select type for 'star' rating from 1 through 5. I will try to update this to show 1 through 5 star images but for now shows the numeric value.
I have a custom template specifically for vendors and on the singular vendor content template I want to do two things:
1. display a CRED box allowing viewers to leave a review
2. show all reviews relevant to the vendor.
I have one entry which has the vendor post type content, the views content template filled in and the sections ready to show the 'reviews', I also have a CRED form specifically for vendor reviews which had the form auto generated and I added the top links from the guidance here:
I visited this URL: hidden link
I expected to see: the CRED form link (this worked) and when you click the link it displays all the shortcode text but not the form.
Also I wanted the actual form to show on the vendor single page, instead of a link.
Plus I wanted all the relevant reviews to show.
Instead, I got:
The content template (great) but no CRED form or relevant reviews to show.
. . .
Here is my setup & code:
TYPE:
Custom Post Type: vendor
Custom Post Type: vendor-review - only uses the Title option of the custom post type, no other options are selected eg. No Editor or comments etc.
Custom Fields for vendor-review:
Reviewer Name - Single line field
Reviewer Email - Email field
Star Rating - Select field
Vendor Review - Multiple lines field
VIEW - Vendor Review as a Single Post Type.
Query set as: Post type Vendor Review is a child of vendor post type
<wpv-loop>
<div class="one-quarter first">[types field="star-rating"][/types]</div>
<div class="three-quarters"> <h5>[wpv-post-title] ...</h5>
<p>[types field="reviewer-name"][/types]</p>
<p>... [types field="vendor-review"][/types]</p>
</div>
</wpv-loop>
CRED Form:
[credform class="cred-form cred-keep-original"]
[cred_field field="form_messages" value=""]
<div class="vendorsupplier">
<h2>You're currently reviewing: [cred-post-parent get='title']</h2>
<a href="[cred-post-parent get='url']">Back to: [cred-post-parent get='title']</a>
</div>
<div class="cred-field cred-field-post_title">
<label class="cred-label">
Vendor Review Name
</label>
[cred_field field="post_title" post="vendor-review" value="" urlparam=""]
</div>
<div class="cred-group cred-group-Vendor-Reviews">
<div class="cred-header"><h3>Vendor Reviews</h3></div>
<div class="cred-field cred-field-reviewer-name">
<label class="cred-label">
Reviewer Name
</label>
[cred_field field="reviewer-name" post="vendor-review" value="" urlparam=""]
</div>
<div class="cred-field cred-field-reviewer-email">
<label class="cred-label">
Reviewer Email
</label>
[cred_field field="reviewer-email" post="vendor-review" value="" urlparam=""]
</div>
<div class="cred-field cred-field-star-rating">
<label class="cred-label">
Star Rating
</label>
[cred_field field="star-rating" post="vendor-review" value="" urlparam=""]
</div>
<div class="cred-field cred-field-vendor-review">
<label class="cred-label">
Vendor Review
</label>
[cred_field field="vendor-review" post="vendor-review" value="" urlparam=""]
</div>
</div>
<div class="cred-group cred-group-parents">
<div class="cred-field cred-field-_wpcf_belongs_vendor_id">
<label class="cred-label">
vendor Parent
</label>
[cred_field field="_wpcf_belongs_vendor_id" value=""]
</div>
</div>
[cred_field field="form_submit" value="Submit" urlparam=""]
[/credform]
As the CRED form is creating a new review for a predefined parent custom post type, is there a way to show but disable the drop down selector for 'parent'? This way visitors can only see the form when sent to it from the vendor page, and not the other way around by selecting a vendor to review.
Thank you.
Cathie.