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
- A tool to analyze rewrite rules? [closed]
- API to trigger prompt on leaving page
- Are shortcodes case-sensitive?
- Copy Tags from one post type to another post type
- Backslashes being stripped from CSS
- Extending WP_List_Table seems getting wrong with $this->get_columns() – what’s wrong?
- Finding posts containing matching array elements in a meta field usign WP_Query
- Namespaced action and filter tags
- Adding Dropbox dropin js using wp_enqueue_script
- Can Page Templates be Applied to Archive and Post Templates?
- WooCommerce Admin Reports : Get custom product report based on date range
- Auto gallery from folder contents
- Is there a plugin that will allow a tag cloud to be created from any mysql field?
- Allow users to add / remove settings in plugin
- Update problem with update_option() in combination with register_setting()
- Is it possible to enable and disable wp debug from functions.php?
- Default settings aren’t used
- How to change WooCommerce loop product title HTML output in single product page and archive page
- Does WordPress default CSS have Grids?
- Count products with custom metadata field in an order
- BuddyPress and namespacing
- Fatal error: Call to a member function query() on a non-object in my ajaxpage
- Loop output for custom plugin [solution found]
- How to Pass ID through Short Code