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
- WooCommerce Order Sync via Custom REST API Endpoint Failing
- How to avoid double add to cart AJAX Add to card Woocommerce?
- Woocommerce – Add a product to cart programmatically via JS or PHP [closed]
- ( Woocommerce) How to get the user belonging to an order? [closed]
- Get the product list of a given Category ID
- List of JS events in the WooCommerce frontend
- get woocommerce My account page link
- WooCommerce: How to edit the get_price_html
- Get woocommerce product price by id [closed]
- Product categories don’t appear as option to build menu
- WooCommerce Variable Product Price not showing on single product page
- How to override WooCommerce template files?
- Woocommerce add extra field to variation product
- Getting the gallery images from products in woocommerce?
- How to get current product category ID in product archive page
- Get url of product’s images (woocommerce)
- WooCommerce prices location in DB
- AJAX search on post pages by custom post type
- Order by rating not works in wp_query
- Woocommerce: How to remove page-title at the home/shop page but not category pages
- Woocommerce show cross sells on singe product page [closed]
- How to add a new endpoint in woocommerce
- Development of a WordPress Search Plugin – Best Practices
- Are there any hook or filter when refund is done through admin -woocommerce
- Template issues getting ajax search results
- How to check if is in cart page? [closed]
- Display single product attribute value on Shop page (Woocommerce)
- WP/WooCommerce REST API cart/checkout/order [closed]
- how to use wc_create_order with subscription product
- WooCommerce: Webhook disabled on its own
- Share users and WooCommerce memberships between two installations
- Slow Loading Attribute Select – WooCommerce Backend
- WooCommerce: Can’t use wc_get_products for custom REST API endpoints
- How to change or add Woocommerce thank you page URL key content?
- WordPress post sorting with AJAX
- How can I define a custom template for woocommerce [products] shortcode? [closed]
- How to remove an action within a class with extends
- single-product.php template not working for single products [closed]
- Insert variations via woocommerce api [closed]
- WooCommerce get physical store address
- Is it possible to add custom fields to a WooCommerce attribute term? [closed]