Retrieve list of product titles via AJAX
-
I want to query Woocommerce from my themes main.js file (/themes/my_theme/js/main.js) using $.ajax() and return a simple array or JSON object of product titles from a specific category ID.
I just need the product titles, not the HTML, not the sidebar links, or product objects. Just the titles. How do I do this?
I looked into using ‘/wp-admin/admin-ajax.php’ but wasn’t sure which action to use. Can I just write a custom PHP script in my /inc folder using global $wpdb?
How do I do this, just a simple db lookup, but from Ajax?
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Retrieve list of product titles via AJAX’ is closed to new replies.