Shreyas Khatri
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 |
---|---|---|---|---|---|
Show Variation Product on WooCommerce shop and other archive pages
Started by: Shreyas Khatri in: Toolset Professional Support |
2 | 6 | 2 years, 10 months ago | ||
Query only posts that have relationship items assigned in many to many relation
Started by: Shreyas Khatri in: Toolset Professional Support |
2 | 4 | 3 years ago | ||
Exclude specific category while include some via shortcode parameter
Started by: Shreyas Khatri in: Toolset Professional Support |
2 | 3 | 4 years, 8 months ago | ||
User Field Group not appearing on user edit field
Started by: Shreyas Khatri in: Toolset Professional Support |
2 | 2 | 4 years, 10 months ago | ||
OceanWP’s Custom Footer not loading on CPT single rendered by Content Template
Started by: Shreyas Khatri in: Toolset Professional Support |
2 | 2 | 5 years ago | ||
Preview user created via CRED user form while the payment status is pending
Started by: Shreyas Khatri
in: Toolset Professional Support
Problem: I would like to use a CRED Commerce form to create Users. While payment is pending, I would like to be able to show a preview of the User on my site, but I cannot use Views to display the User yet. How can I show a preview of the pending User account? Solution: You cannot access a pending User's account information, because that information does not exist in an accessible way in the database. Instead, you could use the CRED API to insert a temporary post using the information gathered by your CRED Commerce form. Then use that temporary post as a placeholder for your pending User. Relevant Documentation: |
2 | 5 | 6 years, 3 months ago | ||
Pass CRED Fields / First Name to WooCommerce Billing_First_Name
Started by: Shreyas Khatri
in: Toolset Professional Support
Problem: I am using CRED Commerce to create new Users. I would like to capture the User's first name, last name, address, and email address in the CRED User form, then pre-populate the checkout fields with that information. Solution: This will require custom code using the CRED Commerce API cred_commerce_form_action: yoursite.com/checkout?first=John&last=Smith&address=123&email=abc Then in your filter, you can access those variables from the $_GET superglobal. Here's a very simple example: add_action('cred_commerce_form_action', 'my_commerce_form_action',10,4); function my_commerce_form_action( $action, $form_id, $post_id, $form_data ) { if ($form_id == 1234) { // uncomment next line to inspect the entire post object using server logs. // error_log(print_r($_POST, true)); $first = $_POST['first_name']; // ... // get the 3 other parameters from the POST object and add them here // ... wp_redirect( '/checkout?first=' . $first); // add all 4 parameters to the URL string here exit(); } } Then in your woocommerce_checkout-fields filter, you should be able to access the URL parameters in the $_GET superglobal: add_filter( 'woocommerce_checkout_fields' , 'kia_checkout_field_defaults', 20 ); function kia_checkout_field_defaults( $fields ) { $first_name = isset($_GET['first']) ? $_GET['first'] : ''; $fields['billing']['billing_first_name']['placeholder'] = 'First Name'; $fields['billing']['billing_first_name']['default'] = $first_name; return $fields; } I'm not able to provide support for the woocommerce_checkout_fields API, because it is not part of our software. You should consult the WooCommerce documentation for more information there. Relevant Documentation: https://toolset.com/documentation/programmer-reference/cred-commerce-api/#cred_commerce_form_action https://docs.woocommerce.com/document/checkout-field-editor/ |
3 | 6 | 6 years, 4 months ago | ||
Pass CRED Fields and Custom User Fields Data to WooCommerce Checkout
Started by: Shreyas Khatri in: Toolset Professional Support |
3 | 3 | 6 years, 5 months ago | ||
Filter posts by custom date field greater than equal to today
Started by: Shreyas Khatri in: Toolset Professional Support |
2 | 4 | 6 years, 9 months ago | ||
Infinite scrolling replaces first 10 posts but thereafter works properly
Started by: Shreyas Khatri
in: Toolset Professional Support
Problem: Views that use infinite scrolling do not seem to update correctly. Instead of appending to the first set of results, the first set is replaced. Then results are appended as expected. Solution: It appears in this case that Cloudflare HTML Minification conflicts with Infinite Scrolling. Once disabled, Views begin to update as expected. |
2 | 7 | 6 years, 9 months ago | ||
Set min-date for end date greater start-end selection
Started by: Shreyas Khatri
in: Toolset Professional Support
Problem: I would like to set a minimum end date for my range datepicker based on the value selected for the start date. Users should not be able to select an end date before the start date. Solution: Add some JavaScript that will set datepicker options using the 'onClose' datepicker option: jQuery(document).ready(function () { var toolset_date_range_handler = function(date, datepicker) { jQuery('.js-wpv-date-front-end-event-end-date-and-time').datepicker('option', 'minDate', date); }; jQuery('.js-wpv-date-front-end-event-start-date-and-time').datepicker('option', 'onClose', toolset_date_range_handler); }); Relevant Documentation: http://api.jqueryui.com/datepicker/#option-onClose |
2 | 3 | 6 years, 10 months ago | ||
Filter archive view using cookies
Started by: Shreyas Khatri in: Toolset Professional Support |
2 | 2 | 6 years, 10 months ago | ||
Infinite Scroll replaces the first page of pagination instead of scrolling
Started by: Shreyas Khatri in: Toolset Professional Support |
2 | 4 | 6 years, 11 months ago | ||
Previous and Next Post Navigation when sorted by menu order
Started by: Shreyas Khatri
in: Toolset Professional Support
Problem: < Previous : Post Name | Post Name : Next > Solution: 1. For this you should create custom shortcodes. Please add this code in your theme’s or child theme’s functions.php file: add_shortcode( 'next_post', 'next_shortcode' ); function next_shortcode($atts) { global $post; ob_start(); next_post_link( '<span class="nav-next">%link : Next ></span>', '%title' ); $result = ob_get_contents(); ob_end_clean(); return $result; } add_shortcode( 'prev_post', 'prev_shortcode' ); function prev_shortcode($atts) { global $post; ob_start(); previous_post_link( '<span class="nav-previous">< Previous : %link</span>', '%title' ); $result = ob_get_contents(); ob_end_clean(); return $result; } // Customize Post Link Order function my_custom_adjacent_post_where($sql) { if ( !is_main_query() || !is_singular() || 'playground' != get_post_type() ) return $sql; $the_post = get_post( get_the_ID() ); $patterns = array(); $patterns[] = '/post_date/'; $patterns[] = '/\'[0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2}\'/'; $replacements = array(); $replacements[] = 'menu_order'; $replacements[] = $the_post->menu_order; return preg_replace( $patterns, $replacements, $sql ); } add_filter( 'get_next_post_where', 'my_custom_adjacent_post_where' ); add_filter( 'get_previous_post_where', 'my_custom_adjacent_post_where' ); function my_custom_adjacent_post_sort($sql) { if ( !is_main_query() || !is_singular() || 'playground' != get_post_type() ) return $sql; $pattern = '/post_date/'; $replacement = 'menu_order'; return preg_replace( $pattern, $replacement, $sql ); } add_filter( 'get_next_post_sort', 'my_custom_adjacent_post_sort' ); add_filter( 'get_previous_post_sort', 'my_custom_adjacent_post_sort' ); ==> Whereas ‘playground’ is your custom post type slug, that you need to replace in the above code. 2. Then, add this shortcode in your Content Template to display Previous and Next post links: [prev_post] | [next_post] |
3 | 10 | 6 years, 11 months ago | ||
Menu positions created by layouts missing after layouts update
Started by: Shreyas Khatri in: Toolset Professional Support |
1 | 2 | 7 years, 2 months ago |