I’m not so professional in this but I have a solution you can try. You can create custom page templates in WordPress and place your form code in that template and in another template create your result page and pass the query using POST method to the result page template. Then with php you can get the search query using $_POST and get information from your API. I’ve done this same thing with one of my plugins.
In your search form template:
<form action="yoursiteurl.com/resultpagename" method="post">
<input type="text" name="search" />
</form>
In your result template:
$search_query = $_POST["search"];
$response = wp_remote_get('https://ecourier.com.bd/apiv2/?product_id=' . $search_query);
$body = wp_remote_retrieve_body( $response );
$data = json_decode( $body, true );
var_dump($data);
Let me know if this works or not.
Related Posts:
- Difference Between Filter and Action Hooks?
- How can you check if you are in a particular page in the WP Admin section? For example how can I check if I am in the Users > Your Profile page?
- How to create an API for my plugin?
- How to store username and password to API in wordpress option DB?
- How do I improve this admin query snippet to avoid generating duplicate results on non-meta searches?
- Is there a limit on making calls to WordPress.org API’s?
- Using filters and actions for plugin API?
- WordPress and multithreading
- How to make dynamically-generated content searchable in WordPress?
- permalinks with get variables
- Displaying search results in the widget itself?
- Build dynamic page from cURL (HTML page) response with plugin
- How to override a function call in functions.php?
- wp_enqueue_style built in styles
- Should I ask my Twitter plugin users to create their own Twitter App and API Keys to use my plugin?
- Does WordPress’s HTTP API use any caching?
- Make WordPress cache permanent for some pages until edited
- Example Dashboard Widget, Cancel not working
- modify wordpress default search
- Amending REST API function without deactivate/activate plugin every time changes is made
- Why does wp_remote_post returns an empty body response on certain endpoints?
- what are the checksums surrounding keywords in the SQL generated by WP_Query and do I need to use them too?
- Adding custom end points, No error line
- Search the product by tag or category not working
- Sending post request with wp_remote_post not working correctly
- Search and Filter
- woocommerce_checkout_order_processed hook executing function twice
- Using ob_get_content to get_search_form puts into infinite loop
- What to hook into to check a value before a post is published?
- How can I replace the search results displayed by WordPress?
- Encoding Method for URLs?
- Google credentials and redirect URI for Google OAuth2 in a WordPress plugin, questions
- Plugin index page code executes multiple times
- Pass CF7 form data to plugin
- Best way to ping for the API changes in the wordpress?
- Plugin architecture to pull from API & create dynamic content on WP site?
- Lead form that submits to 2 external APIs
- Widget internal hooks and functions
- Allow REST API Endpoint to specific user and hide from public
- Custom Endpoint – Does it possible to use PUT method with WP API Rest?
- Showing results from json-string in WordPress search results page
- Get API auth_token token to renew weekly
- Ajax action has 200 status but response of No response data available for this request
- How to query a nested field in wordpress api using _fields param
- ajax stopped working when not logged in wordpress
- call funcution when clicking submit
- Get search result count in plugin
- Adding Amchart Interface to WordPress API
- How do I make secure API calls from my WordPress plugin?
- Using AJAX to submit and return data inside the WordPress Plugin Boiler Plate framework
- Hiding WordPress REST endpoints from public viewing using Basic Authentication
- add pagination to wp_remote_get
- Multisite and the JSON REST API: How to?
- How do WordPress plugins work with oAuth2 APIs?
- Modify search form with plugin
- WP Query Relations / Compare
- WordPress Search Form with Keyword Suggestion
- API WordPress is Limited? Return False
- Tie specific functions to options-update for limiting API requests
- Simple Search Plugin Does Not Perform Search
- Do you see any problems (mainly security-related) with how I’ve used wp_ajax_* actions?
- How to search on the field that stores escaped strings?
- Is there a way to tell if a shorcode’s handler is being run before or after the content formatting filter?
- Can a plugin differentiate syndication feeds from actual site views?
- Change the search results header from plugin
- Developing a plugin, ran it through P3 Profiler, shows up slow, but I don’t know why
- How to create a custom search form and handler?
- Get custom wp_query search results to appear on search.php
- add_rewrite_rule not working
- How do I query posts and have their related taxonomies returned in the results?
- modify buddpress adminbar only in admin pages
- How to update WordPress Plugins in your own maintance application?
- Programmatically creating posts based on external JSON feed (asynchronously)
- External api call using wordpress
- Why is WordPress wrapping search for users that looks like integers with asterisks and how do I fix it?
- Hook a search form anywhere on the site, using a custom plugin
- Query posts which are related via postmeta
- WordPress getting data from external API
- how to send csv file to other server using wp_remote_post?
- How do I return XML to an API post request
- Is there any plugin development framework
- Handling results from data hooked into admin_post
- Get list of available wordpress actions
- How can i list current author’s categories?
- Rest Api How to get results of child categories with one api call
- Add Post and Comments menu no longer visible
- Modify hard-coded conditionals for roles to custom roles
- How to access noticeOperations from withNotices
- Thickbox doesn’t respect dimensions when used in admin [duplicate]
- How to create a digital product download link that can’t be used twice?
- How to change a field in database through a submit button or Checkbox? [closed]
- Grandchildtheme (plugin) add header.php (not exist in child theme)
- search content of pages and list in wp-admin
- How to make every image title equal to alt text(wordpress/woocommerce)?
- Load specific page when a custom URL is hit
- Trying to rename a file upload as the hash of file content on wordpress
- Getting products information, in woocommerce based on products ID
- Include add_post_meta in a plugin
- isset($_POST[‘submit’]) ignored on comment submission
- Can we write custom DOM manipulation inside edit.js file while developing custom Gutenberg block?