sarahK-2
Support threads created in the last 30 days: 0
Favorite Forum Topics
This user has no favorite topics.
Forum Topics Created
Status | Topic | Supporter | Voices | Posts | Freshness |
---|---|---|---|---|---|
Access permissions, read own posts but not others
Started by: sarahK-2 in: Toolset Professional Support |
3 | 5 | 4 years, 11 months ago | ||
Restricting Access to Some Linked PDFs and Other Files
Started by: sarahK-2 in: Toolset Professional Support |
2 | 3 | 5 years, 3 months ago | ||
Order by field of parent post
Started by: sarahK-2 in: Toolset Professional Support |
2 | 3 | 5 years, 7 months ago | ||
Is there a way to automatically connect the registration and the order.
Started by: sarahK-2
in: Toolset Professional Support
Problem: Setup one-to-one post type relationship between post types "Order" and "Puppy Registrations" after user complete the Woocommerce order. Solution: It needs custom codes, see details here: Relevant Documentation: |
2 | 5 | 5 years, 9 months ago | ||
Connecting Toolset form and data with Woocommerce products and orders
Started by: sarahK-2
in: Toolset Professional Support
Problem: Use Toolset Forms Commerce plugin to create new post and place order, in a single order post, display related post information. Solution: There is a hidden field "_cred_post_id" in single order post, it stores value of correspond post ID. So you can use it to get the related post information, for example: Relevant Documentation: https://wp-types.com/documentation/user-guides/views-shortcodes/#wpv-post-body |
2 | 9 | 5 years, 10 months ago | ||
Count number of entries in repeating field
Started by: sarahK-2
in: Toolset Professional Support
Problem: I have a field (date field) that records the date every time that a client takes a class, What I really need is an "at a glance" count. So, I would like this view to display instead: count number of multiple instance field. Solution: There isn't such a built-in feature, as a workaround, you can create a custom shortcode for it, like this: https://toolset.com/forums/topic/count-number-of-entries-in-repeating-field/#post-1207355 Relevant Documentation: |
2 | 3 | 5 years, 11 months ago | ||
Query a view using a date field from a related post
Started by: sarahK-2
in: Toolset Professional Support
Problem: I have a one-to-many post relationship set up between Trial Days and Showings. I would like to display a list of Showings from the Trials Days with a custom field date in the last few days. Solution: You can set up a View of Trial Days, filtered by the trial date custom field. Apply your 'n' number of days to the query filter of this View. You can place this View on your site temporarily to confirm the correct Trial Days are being displayed. Next create a View of Showings, filtered by post ID, set by a shortcode attribute "ids". In the Loop of this View, add the post title for now. You can modify the display later. Next, add this code in your child theme's functions.php file, or create a new snippet in Toolset > Settings > Custom code: function ts_get_recent_children_func( $atts ){ $parent_view_id = 12345; $child_view_id = 56789; $relationship_slug = 'some-slug'; // do not edit below this line $parents = get_view_query_results( $parent_view_id ); $query_parents = array( 'parent' => array_column($parents, 'ID'), ); $child_ids = toolset_get_related_posts( $query_parents, $relationship_slug, array( 'parent', 1000000, 0, array(), 'post_id', 'child' ) ); $child_view_args = array( 'id' => $child_view_id, 'ids' => implode(',', $child_ids) ); $children = render_view( $child_view_args ); return $children; } add_shortcode( 'ts-get-recent-children', 'ts_get_recent_children_func' ); You must edit the parent View ID to match the numeric ID of your View of Trial Days. You must edit the child View ID to match the numeric ID of your View of Showings. You must also edit the relationship slug to match your Trial Days > Showings relationship slug. You can find that in Toolset > Relationships when you edit this relationship. Finally, insert this custom shortcode where you want to display recent Showings: [ts-get-recent-children] Relevant Documentation: |
2 | 5 | 6 years ago | ||
Cred show group if grandparent is
Started by: sarahK-2
in: Toolset Professional Support
Problem: I have two one-to-many post relationships that create a grandparent, parent, and child post. I have a Form that lets Users create child posts for a specific parent post. I would like to create a conditional group in the Form based on a field in the grandparent post. Solution: Try this custom code in your child theme's functions.php file, or in a new snippet in Toolset > Settings > Custom code: add_shortcode( 'ts-grandparent-field', 'ts_grandparent_field_func' ); function ts_grandparent_field_func( $atts ) { $a = shortcode_atts( array( 'grandparent-parent' => null, 'url-param' => null, 'field' => null, ), $atts ); if( !$a['grandparent-parent'] || !$a['url-param'] || !$a['field'] ) { return; } $parent_id = isset($_GET[$a['url-param']]) ? $_GET[$a['url-param']]: 0; if( !$parent_id ) return; $grandparent_id = toolset_get_related_post( $parent_id, $a['grandparent-parent'], 'parent'); if( !$grandparent_id ) return; return get_post_meta( $grandparent_id, 'wpcf-' . $a['field'], true); } Then you can use it like this: Class info: [ts-grandparent-field grandparent-parent="class-starting" url-param="parent_starting_id" field="class-info"][/ts-grandparent-field] |
2 | 5 | 6 years, 1 month ago | ||
Product Selection WooCommerce and Forms
Started by: sarahK-2
in: Toolset Professional Support
Problem: I would like to use Forms Commerce to programmatically add different products to the User's cart depending on the location of the Form they submit. Solution: Choose the option "Always this product, regardless of inputs" and select any product. Then add a generic hidden field to the Form. Set the default value of the hidden field to be the current post ID, like this: [cred_generic_field field='current-post-id' type='hidden' class='' urlparam=''] { "required":0, "validate_format":0, "default":"[wpv-post-id id='$current_page']" } [/cred_generic_field] Then you can use custom code with the Forms Commerce API to manipulate the product by ID. add_filter( 'cred_commerce_add_product_to_cart', 'which_product_hook', 10, 3 ); function which_product_hook( $product_id, $form_id, $post_id ) { if ( $form_id == 123 && isset($_POST['current-post-id']) ) { $product_id = 456; // or use the toolset_get_related_post API to get the parent / grandparent of the current post } return $product_id; } Relevant Documentation: |
2 | 3 | 6 years, 1 month ago | ||
many to many relationships and repeating field groups
Started by: sarahK-2 in: Toolset Professional Support |
1 | 2 | 6 years, 2 months ago | ||
Display custom post fullwidth in Divi
Started by: sarahK-2 in: Toolset Professional Support |
2 | 2 | 6 years, 6 months ago | ||
Repeatable fields view showing unattached copy of extra notation before items
Started by: sarahK-2 in: Toolset Professional Support |
2 | 4 | 6 years, 8 months ago | ||
Display recent files uploaded within custom post type
Started by: sarahK-2
in: Toolset Professional Support
Problem: The issue here is that the customer wanted to display their recently uploaded files to a CPT. Solution: The way I see this working is that you list out the members post in our view plugin ordered by the post date and just printing out the files of that post. We would need to do it this way since we cant query the media library directly. |
2 | 3 | 6 years, 8 months ago |