What I understood is that no AJAX is needed. If somebody don’t understand all the fancy example around, you just need to use the pre_get_posts hook. In my case what I did is:
function custom_product_search($query) {
$query->query_vars['post_parent'] = htmlentities($_GET['model']) ?? htmlentities($_GET['make']);
return $query;
}
add_action("pre_get_posts", 'custom_product_search');
I don’t know if this is the correct solution but it is working one.
Related Posts:
- Woocommerce Multisite global search how to mod ajax function?
- Woocommerce ajax search can’t work on mobile
- Search results don’t show products
- WooCommerce add_to_cart() with custom price [closed]
- wc_get_product in a none woocommerce page
- WooCommerce add_to_cart url not working [closed]
- How to search Woo Commerce products with punctuation in title?
- Mini cart in header using divi is not getting updated on changing the cart items count:
- Woocommerce wp-admin search products through custom meta value too
- if statement for search results
- woocommerce_package_rates not fired everytime
- Problems adding in-store product managers
- Javascript / Ajax Error After Migrating To New Domain Name
- Separeting product from post in search result
- Programatically Remove Item from Cart Not Working – Needs Page Refresh
- Woocommerce custom search
- In WooCommerce product archive, how can you also set the quantity to be added to cart by typing, instead of just by using +/-?
- WooCommerce update_shipping_method ajax call wipes shipping method set on non-checkout page [closed]
- Change the Title Tag of Search Products Page
- WooCommerce orderby template disappears and not longer works on search page
- search customers in front end by billing data
- CF7 Ajax isn’t working when called inside WooCommerce “woocommerce_before_add_to_cart_button” hook [closed]
- ajax request in wordpress
- Create a shortcode for native WooCommerce search form [closed]
- Can’t find a product by SKU
- Absolute search against wordpress api
- WooCommerce event works in jQuery but not in JavaScript
- override the default WooCommerce products search form
- Woocommerce AJAX filters option loading spiner – problem on mobile device
- Trying to run Javascript on AJAX call
- WooCommerce variable product can not add to cart using ajax after updating latest version of WooCommerce
- Create a Search Form that only Searches with WooCommerce Sale Products
- Running JavaScript after using WooCommerce Filter Plugin
- call_user_func_array() expects parameter 1 to be a valid callback, class ‘WC_Rapyd’ does not have a method ‘install’
- Search doesn’t return anything
- woocommerce deposit Form with AJAX and shortcode won’t update but add to previous output
- edit URL of search result
- Woocommerce Variation product added twice to cart
- No Results in WooCommerce Product Search
- woocommerce REST api on the website’s front-end
- Pass values to ajax
- Unable to call woocommerce hook in my custom php file
- Fragments to Update Cart Counter not working on homepage – Woocommerce
- I wan redirect link post search to search product woocommerce?
- How to filter result set in custom metaboxes?
- Overriding Plugin function in your child theme
- Update / refresh mini cart, after custom AJAX add_to_cart event
- Woocommerce: Search by custom attribute
- Can’t update WooCommerce payment method title
- Notice: Trying to get property of non-object in
- Using category and its sub-categories products attributes as filter in products pages
- Removing Product from Woocommerce checkout page using Ajax
- How can I change my search form to bring up product results, not blog results
- add_filter not works in ajax
- SyntaxError: unterminated string literal – if WordPress Debug in wp-config is set to true
- How to add ajax loading icon after click add to cart button on woocommerce
- Is it possible to hide certain products from displaying in the search results
- WordPress error
- Woocommerce – Include custom user meta in order ‘filter by registered customer’ Ajax search
- Add product attribute to Woocommerce’s blocks in Gutenberg
- The correct way to override WooCommerce product gallery from a plugin [closed]
- global $post; in WooCommerce
- Woocommerce template single-product.php in theme folder not working
- How can i create a WooCommerce product programatically or using sql query?
- differentiate hooks and filters on the same page [closed]
- Signup Form that adds customer to MailChimp, redirects to checkout, and fills in form data
- how to pass a woocommerce product name to contact form7 [closed]
- Woocommerce Subscription Pricing/Billing Schedule
- Automatically running Scheduled Actions
- Hook to use when customer placing order
- Woocommerce Rest Api Categories problem [closed]
- One file for all virtual, downloadable product variations [closed]
- WooCommerce: One term for Many Product Attributes
- Clients with empty username are not receiving request new password email
- how can i add an additional action into woocommerce admin order page through my plugin?
- Adding custom cart price with Ajax in wordpress
- Display data when category is empty
- Disable woocommerce PLACE ORDER button if user selected products that are not available for international delivery
- Remove sale signs from site in branded? [closed]
- How to hide order action button after changing order status to completed
- Combine one action and one filter
- How to run code when cookie is added?
- Return product list based on current product attribute
- price of product can’t return when get data of product in functions.php
- Applying pre-production modifications
- WooCommerce – Remove automaticly added membership product if user remove regular product from cart
- Product related to post by title
- How to change the link of product menu from wordpress admin panel
- Anchor link to every product
- Plugin could not be activated because it triggered a fatal error
- Woocommerce custom product with JS script, can’t understand how it works [closed]
- Rename woocommerce button [closed]
- Create templates from attributes for categories
- dakon show vender address on checkout page
- Adding total_sales to Grouped Product within WooCommerce
- acf_form() – “On Update” action [closed]
- Trying to insert a div ID link into Woocommerce shortcode Pagination
- Remove login fields from /customer-account page [closed]
- Loading specific ajax from a product
- Getting Uncaught SyntaxError: Unexpected token ‘