Forum Replies Created
-
AuthorPosts
-
dilinanand_Nsv5
ParticipantOk thanks
dilinanand_Nsv5
ParticipantAlready published, but not got price at 78 euros, can you help me in this?
I have attached the invoice.
dilinanand_Nsv5
ParticipantOkay.
Thanks for your help and quick response.
dilinanand_Nsv5
ParticipantGreat, it is working. The items are removed.
Also I want to know can I have users as result items on results page?
dilinanand_Nsv5
ParticipantWhile adding this code, should I enable the user search option?
Also this code will not conflict with other code of asp? I have below codes added currently// Hook into Ajax Search Pro’s form rendering to inject a hidden input with the category ID
add_action(‘asp_layout_in_form’, ‘asp_layout_in_form_archive_input’, 10, 1);
function asp_layout_in_form_archive_input($search_id) {// Only apply to these instance IDs
$allowed_ids = array(11, 12); // update these as needed
if (!in_array($search_id, $allowed_ids)) return;global $wp, $post;
$term = null;// 1. On a category archive page (handles nested child categories too)
if (!empty($wp->query_vars[‘category_name’])) {
$category_path = $wp->query_vars[‘category_name’];
$slugs = explode(‘/’, $category_path); // For nested categories
$last_slug = end($slugs); // Use the final slug$term = get_term_by(‘slug’, $last_slug, ‘category’);
}// 2. On search results page, get category from URL parameter
if (isset($_GET[‘asp_tax_archive’])) {
$term_id = intval($_GET[‘asp_tax_archive’]);
$term = get_term($term_id, ‘category’);
}// Output hidden input field if valid term is found
if (!empty($term) && !is_wp_error($term)) {
echo ‘<input type=”hidden” name=”asp_tax_archive” value=”‘ . esc_attr($term->term_id) . ‘” data-asp-hidden-field>’;
}
}// Modify the Ajax Search Pro query arguments to restrict search results to a specific taxonomy term (e.g., category)
add_filter(‘asp_query_args’, ‘asp_archive_page_category_restriction’, 10, 2);
function asp_archive_page_category_restriction($args,$search_id) {// Only apply to these instance IDs
$allowed_ids = array(11, 12);
if (!in_array($search_id, $allowed_ids)) return $args;$archive_term_id = null;
// Case 1: If the search options are submitted via POST, extract the hidden category ID
if (isset($_POST[‘options’])) {
parse_str($_POST[‘options’], $so);if (!empty($so[‘asp_tax_archive’])) {
$archive_term_id = $so[‘asp_tax_archive’];
}
}// Case 2: If the search was triggered via a GET request, fetch the category ID from the URL
elseif (!empty($_GET[‘asp_tax_archive’])) {
$archive_term_id = $_GET[‘asp_tax_archive’];
}// If a valid taxonomy term ID is present, modify the search query to filter by that term
if ($archive_term_id) {
$term = get_term($archive_term_id);if (!is_wp_error($term)) {
$args[‘post_tax_filter’][] = array(
‘taxonomy’ => $term->taxonomy, // e.g., ‘category’
‘include’ => array($term->term_id), // Term ID to include
‘exclude’ => array(), // No exclusions
‘logic’ => ‘AND’, // Combine filters using AND logic
‘allow_empty’ => false // Do not allow empty result sets
);
}
}return $args;
}dilinanand_Nsv5
ParticipantYes, when I disable the option the item gets removed. But I want the user search.
dilinanand_Nsv5
ParticipantCan we have a google meet so that I can explain you better?
dilinanand_Nsv5
ParticipantCan you check new product category
https://www.electronicsforu.com/news/indoor-uvb-solution-for-well-being
https://www.electronicsforu.com/news/tire-monitoring-system-for-safer-driving
https://www.electronicsforu.com/news/high-performance-quad-serial-receiversI have added new products search bar, but it is not showing for this category
dilinanand_Nsv5
ParticipantYou can check startup categoriessetting, I will be sharing startup articles
https://www.electronicsforu.com/india-corner/whatsapp-based-chat-platform-for-easy-ev-booking-charging-and-payments
https://www.electronicsforu.com/india-corner/iot-bridging-the-gap-from-farm-to-fridge-in-dairy-innovation
https://www.electronicsforu.com/india-corner/battery-oks-ev-doctor-ai-device-transforming-global-battery-diagnosticsdilinanand_Nsv5
ParticipantYou cannot access this content.
dilinanand_Nsv5
ParticipantOk, kindly share email id so that I can share you admin rights on any of our website.
dilinanand_Nsv5
ParticipantI have created a search bar for a subcategory, so it is only showing those articles which has that sub category selected, if the primary category is some other the search bar is not showing.
dilinanand_Nsv5
ParticipantI mean that if one category is in primary category and other sub category is in another set of primary category, will the search be affected?
November 27, 2024 at 9:09 am in reply to: My website loads increases suddenly for 5-10 min during search #52080dilinanand_Nsv5
ParticipantYou cannot access this content.
November 26, 2024 at 10:04 am in reply to: My website loads increases suddenly for 5-10 min during search #52045dilinanand_Nsv5
ParticipantYou cannot access this content.
-
AuthorPosts