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
- How to turn off WooCommerce user registration and manually create accounts?
- Change WooCommerce Image Size in One Product CAtegory
- Woocommerce Shop Price Position
- How to disable users from editing billing address in WooCommerce checkout?
- How do I hide the purchase note in the WooCommerce ‘order completed’ email?
- Woocommerce – Override the default templates location under the theme directory
- How to hide out of stock products in Related Products via custom query in WooCommerce
- Changing Woocommerce language without changing the language in Dashboard admin WordPress
- Function to recalculate shipping costs on subscriptions after renewal with Automatewoo
- Creating a multisite registration form that also creates a woocommerce post
- How to show tag count for individual product post in wordpress woocommerce
- API returns blank response after installing & uninstalling WP-rest-api plugin
- Redirect no product url’s to static url
- Adding a custom Shipping methods field to an order
- Migrating data from Woocommerce to another webapp
- Purchase/order statistics plugin for viewing per payment menthod?
- woocommerce_product_quick_edit_save hook not fired
- Changing Title Tag on Shop Archive Page (current solution reverting to Title of First Product in Loop)
- Delete comma in front of currency woocommerce
- Not displaying Category and subcategory from woocommerce Pluign
- currentURL is not defined
- Woocommerce REST API not considering discounts and coupons
- Multiple sorting criteries (order by)
- Allow authors to use their own PayPal account and payment process automation [closed]
- Can a woocommerce hook alter the UI of a website?
- registration_errors not working
- How to dublicate WC Product title to shortdescription field? [closed]
- Add Additional 3 buttons next to “Add to cart” button in woocommerce product page
- How do I remove the recurring total from thank you for your order email?
- Translate Woocommerce tab
- Woocommerce -> gallery images per variation without a plugin? [closed]
- Why is my WordPress admin not working
- Create bookings after subscription renewal
- Change variants URL
- Use a woocommerce hook to create a table and populate it with a query
- Woocommerce product and category in url [closed]
- Display product categories + child-categories on a single product page
- I want to Display custom woocomerce meta box in orders list
- Detect Product Type with code
- Verify if woocommerce supports this design [closed]
- Hook for Woocommerce checkout fields