Forum Replies Created
-
AuthorPosts
-
abhijitpattil
ParticipantYes, so happy to see this!
abhijitpattil
ParticipantThanks for update! Also, please check FluxStore App They have included compatibility for Ajax Search Pro! Because of your help this was possible at all! Thank you very much!
abhijitpattil
ParticipantHi @Ernest,
Can you please tell me how to show ‘Add To Cart’ Button using this method in Description?
abhijitpattil
ParticipantHi @Ernest,
I will surely try and let you know the results.
abhijitpattil
ParticipantHi @Ernest,
I tried adding
$defaults = $args = array( 's' => '', '_ajax_search' => true );this to functions.php file but the results missing asp_data field completely. Below are results before adding this and after. Can you please check again?
RESPONSE ON POSTMAN (BEFORE)
[ { "ID": 3096, "post_author": "28", "post_date": "2022-01-11 14:37:23", "post_date_gmt": "2022-01-11 09:07:23", "post_content": "Each strip contain 10 tablets", "post_title": "Levocetirizine 5mg and Montelukast 10mg Tablet", "post_excerpt": "Levocetirizine (5mg) + Montelukast (10mg) Tablet", "post_status": "publish", "comment_status": "closed", "ping_status": "closed", "post_password": "", "post_name": "levocetirizine-5mg-and-montelukast-10mg-tablet", "to_ping": "", "pinged": "", "post_modified": "2022-05-10 20:54:12", "post_modified_gmt": "2022-05-10 15:24:12", "post_content_filtered": "", "post_parent": 0, "guid": "http://janaushadhistore.in/?post_type=product&p=3096", "menu_order": 0, "post_type": "product", "post_mime_type": "", "comment_count": "0", "filter": "raw", "asp_guid": "https://janaushadhistore.in/shop/levocetirizine-5mg-and-montelukast-10mg-tablet/", "asp_id": 3096, "blogid": 1, "asp_data": { "id": 3096, "blogid": 1, "title": "Levocetirizine 5mg and Montelukast 10mg Tablet", "post_title": "Levocetirizine 5mg and Montelukast 10mg Tablet", "content": "Levocetirizine (5mg) + Montelukast (10mg) Tablet", "excerpt": "Levocetirizine (5mg) + Montelukast (10mg) Tablet", "image": "https://janaushadhistore.in/wp-content/uploads/Montelukast-Levocetrizine.jpg", "date": "2022-01-11 14:37:23", "post_date": "2022-01-11 14:37:23", "menu_order": 0, "relevance": 1000200, "priority": 100, "group_priority": 1, "p_type_priority": 1, "post_type": "product", "customfp": "1", "customfs": "1", "content_type": "pagepost", "g_content_type": "post_page_cpt", "primary_order": 0, "link": "https://janaushadhistore.in/shop/levocetirizine-5mg-and-montelukast-10mg-tablet/", "asp_guid": "https://janaushadhistore.in/shop/levocetirizine-5mg-and-montelukast-10mg-tablet/" } }, { "ID": 3091, "post_author": "28", "post_date": "2022-01-11 14:29:07", "post_date_gmt": "2022-01-11 08:59:07", "post_content": "Each strip contain 10 tablets", "post_title": "Montelukast 10mg Tablet", "post_excerpt": "Montelukast (10mg) Tablet", "post_status": "publish", "comment_status": "closed", "ping_status": "closed", "post_password": "", "post_name": "montelukast-10mg-tablet", "to_ping": "", "pinged": "", "post_modified": "2022-05-10 20:56:12", "post_modified_gmt": "2022-05-10 15:26:12", "post_content_filtered": "", "post_parent": 0, "guid": "http://janaushadhistore.in/?post_type=product&p=3091", "menu_order": 0, "post_type": "product", "post_mime_type": "", "comment_count": "0", "filter": "raw", "asp_guid": "https://janaushadhistore.in/shop/montelukast-10mg-tablet/", "asp_id": 3091, "blogid": 1, "asp_data": { "id": 3091, "blogid": 1, "title": "Montelukast 10mg Tablet", "post_title": "Montelukast 10mg Tablet", "content": "Montelukast (10mg) Tablet", "excerpt": "Montelukast (10mg) Tablet", "image": "https://janaushadhistore.in/wp-content/uploads/Montelukast-10.jpg", "date": "2022-01-11 14:29:07", "post_date": "2022-01-11 14:29:07", "menu_order": 0, "relevance": 1000200, "priority": 100, "group_priority": 1, "p_type_priority": 1, "post_type": "product", "customfp": "1", "customfs": "1", "content_type": "pagepost", "g_content_type": "post_page_cpt", "primary_order": 1, "link": "https://janaushadhistore.in/shop/montelukast-10mg-tablet/", "asp_guid": "https://janaushadhistore.in/shop/montelukast-10mg-tablet/" } }, { "ID": 3093, "post_author": "28", "post_date": "2022-01-11 14:36:27", "post_date_gmt": "2022-01-11 09:06:27", "post_content": "Each strip contain 10 tablets", "post_title": "Montelukast 10mg and Fexofenadine 120mg Tablet", "post_excerpt": "Montelukast (10mg) + Fexofenadine (120mg) Tablet", "post_status": "publish", "comment_status": "closed", "ping_status": "closed", "post_password": "", "post_name": "montelukast-10mg-and-fexofenadine-120mg-tablet", "to_ping": "", "pinged": "", "post_modified": "2022-05-10 20:55:08", "post_modified_gmt": "2022-05-10 15:25:08", "post_content_filtered": "", "post_parent": 0, "guid": "http://janaushadhistore.in/?post_type=product&p=3093", "menu_order": 0, "post_type": "product", "post_mime_type": "", "comment_count": "0", "filter": "raw", "asp_guid": "https://janaushadhistore.in/shop/montelukast-10mg-and-fexofenadine-120mg-tablet/", "asp_id": 3093, "blogid": 1, "asp_data": { "id": 3093, "blogid": 1, "title": "Montelukast 10mg and Fexofenadine 120mg Tablet", "post_title": "Montelukast 10mg and Fexofenadine 120mg Tablet", "content": "Montelukast (10mg) + Fexofenadine (120mg) Tablet", "excerpt": "Montelukast (10mg) + Fexofenadine (120mg) Tablet", "image": "https://janaushadhistore.in/wp-content/uploads/Montelukast-Fexofenadine.jpg", "date": "2022-01-11 14:36:27", "post_date": "2022-01-11 14:36:27", "menu_order": 0, "relevance": 1000120, "priority": 100, "group_priority": 1, "p_type_priority": 1, "post_type": "product", "customfp": "1", "customfs": "1", "content_type": "pagepost", "g_content_type": "post_page_cpt", "primary_order": 2, "link": "https://janaushadhistore.in/shop/montelukast-10mg-and-fexofenadine-120mg-tablet/", "asp_guid": "https://janaushadhistore.in/shop/montelukast-10mg-and-fexofenadine-120mg-tablet/" } }, { "ID": 3077, "post_author": "28", "post_date": "2022-01-11 13:01:53", "post_date_gmt": "2022-01-11 07:31:53", "post_content": "Each strip contain 10 tablets", "post_title": "Acebrophylline 200mg and Montelukast 10mg Tablet SR", "post_excerpt": "Acebrophylline (200mg) + Montelukast (10mg) Tablet", "post_status": "publish", "comment_status": "closed", "ping_status": "closed", "post_password": "", "post_name": "acebrophylline-200mg-and-montelukast-10mg-tablet-sr", "to_ping": "", "pinged": "", "post_modified": "2022-05-10 21:02:48", "post_modified_gmt": "2022-05-10 15:32:48", "post_content_filtered": "", "post_parent": 0, "guid": "http://janaushadhistore.in/?post_type=product&p=3077", "menu_order": 0, "post_type": "product", "post_mime_type": "", "comment_count": "0", "filter": "raw", "asp_guid": "https://janaushadhistore.in/shop/acebrophylline-200mg-and-montelukast-10mg-tablet-sr/", "asp_id": 3077, "blogid": 1, "asp_data": { "id": 3077, "blogid": 1, "title": "Acebrophylline 200mg and Montelukast 10mg Tablet SR", "post_title": "Acebrophylline 200mg and Montelukast 10mg Tablet SR", "content": "Acebrophylline (200mg) + Montelukast (10mg) Tablet", "excerpt": "Acebrophylline (200mg) + Montelukast (10mg) Tablet", "image": "https://janaushadhistore.in/wp-content/uploads/Acebrophyline-Montelukast_-1.jpg", "date": "2022-01-11 13:01:53", "post_date": "2022-01-11 13:01:53", "menu_order": 0, "relevance": 1000120, "priority": 100, "group_priority": 1, "p_type_priority": 1, "post_type": "product", "customfp": "1", "customfs": "1", "content_type": "pagepost", "g_content_type": "post_page_cpt", "primary_order": 3, "link": "https://janaushadhistore.in/shop/acebrophylline-200mg-and-montelukast-10mg-tablet-sr/", "asp_guid": "https://janaushadhistore.in/shop/acebrophylline-200mg-and-montelukast-10mg-tablet-sr/" } } ]RESPONSE ON POSTMAN (AFTER)
[ { "id": 3096, "blogid": 1, "title": "Levocetirizine 5mg and Montelukast 10mg Tablet", "post_title": "Levocetirizine 5mg and Montelukast 10mg Tablet", "content": "Levocetirizine (5mg) + Montelukast (10mg) Tablet", "excerpt": "Levocetirizine (5mg) + Montelukast (10mg) Tablet", "image": "https://janaushadhistore.in/wp-content/uploads/Montelukast-Levocetrizine.jpg", "date": "2022-01-11 14:37:23", "post_date": "2022-01-11 14:37:23", "menu_order": 0, "relevance": 1000200, "priority": 100, "group_priority": 1, "p_type_priority": 1, "post_type": "product", "customfp": "1", "customfs": "1", "content_type": "pagepost", "g_content_type": "post_page_cpt", "primary_order": 0, "link": "https://janaushadhistore.in/shop/levocetirizine-5mg-and-montelukast-10mg-tablet/" }, { "id": 3091, "blogid": 1, "title": "Montelukast 10mg Tablet", "post_title": "Montelukast 10mg Tablet", "content": "Montelukast (10mg) Tablet", "excerpt": "Montelukast (10mg) Tablet", "image": "https://janaushadhistore.in/wp-content/uploads/Montelukast-10.jpg", "date": "2022-01-11 14:29:07", "post_date": "2022-01-11 14:29:07", "menu_order": 0, "relevance": 1000200, "priority": 100, "group_priority": 1, "p_type_priority": 1, "post_type": "product", "customfp": "1", "customfs": "1", "content_type": "pagepost", "g_content_type": "post_page_cpt", "primary_order": 1, "link": "https://janaushadhistore.in/shop/montelukast-10mg-tablet/" }, { "id": 3093, "blogid": 1, "title": "Montelukast 10mg and Fexofenadine 120mg Tablet", "post_title": "Montelukast 10mg and Fexofenadine 120mg Tablet", "content": "Montelukast (10mg) + Fexofenadine (120mg) Tablet", "excerpt": "Montelukast (10mg) + Fexofenadine (120mg) Tablet", "image": "https://janaushadhistore.in/wp-content/uploads/Montelukast-Fexofenadine.jpg", "date": "2022-01-11 14:36:27", "post_date": "2022-01-11 14:36:27", "menu_order": 0, "relevance": 1000120, "priority": 100, "group_priority": 1, "p_type_priority": 1, "post_type": "product", "customfp": "1", "customfs": "1", "content_type": "pagepost", "g_content_type": "post_page_cpt", "primary_order": 2, "link": "https://janaushadhistore.in/shop/montelukast-10mg-and-fexofenadine-120mg-tablet/" }, { "id": 3077, "blogid": 1, "title": "Acebrophylline 200mg and Montelukast 10mg Tablet SR", "post_title": "Acebrophylline 200mg and Montelukast 10mg Tablet SR", "content": "Acebrophylline (200mg) + Montelukast (10mg) Tablet", "excerpt": "Acebrophylline (200mg) + Montelukast (10mg) Tablet", "image": "https://janaushadhistore.in/wp-content/uploads/Acebrophyline-Montelukast_-1.jpg", "date": "2022-01-11 13:01:53", "post_date": "2022-01-11 13:01:53", "menu_order": 0, "relevance": 1000120, "priority": 100, "group_priority": 1, "p_type_priority": 1, "post_type": "product", "customfp": "1", "customfs": "1", "content_type": "pagepost", "g_content_type": "post_page_cpt", "primary_order": 3, "link": "https://janaushadhistore.in/shop/acebrophylline-200mg-and-montelukast-10mg-tablet-sr/" } ]I have attached json file downloaded from POSTMAN below.
Used URL for test: https://janaushadhistore.in/wp-json/ajax-search-pro/v0/woo_search?s=montekCode added to functions.php file
function asp_custom_rest_handler( $data ) { $id = -2; $defaults = $args = array( 's' => '', '_ajax_search' => true ); foreach ( $defaults as $k => $v ) { $param = $data->get_param($k); if ( $param !== null ) { $args[$k] = $param; } } // Fetch the search ID, which is probably the WooCommerce search foreach ( wd_asp()->instances->get() as $instance ) { if ( in_array('product', $instance['data']['customtypes'] ) ) { $id = $instance['id']; break; } } // No search was found with products enabled, set it explicitly if ( $id == -2 ) { $args['post_type'] = array('product'); } $asp_query = new ASP_Query($args, $id); return $asp_query->posts; } // POST to: http://example.com/wp-json/ajax-search-pro/v1/woo_search add_action( 'rest_api_init', function () { register_rest_route('ajax-search-pro/v0', '/woo_search', array( 'methods' => 'POST', 'callback' => 'asp_custom_rest_handler', )); });abhijitpattil
ParticipantHello again!
Thanks for reply! I have forwarded this to FluxStore App team. I will tell them to test this and experiment. I will contact you if they have any more questions regarding this.
abhijitpattil
ParticipantHi @Ernest,
I have received below message from FluxStore App team that they have successfully implemented Ajax Search Pro to their app. (Screenshot attached).
But they are having trouble showing other product data, like product price, product MRP etc.
Hence, again i am requesting you to kindly help us over here.“Confirm the feature is done and will ready on v3.0 – https://tppr.me/E3U3x
Could you contact Ajax Search Pro on how to display the pricing from the Product? We could not see from the search result.”
abhijitpattil
ParticipantHi @Ernest,
Thank you for taking time to do this! I really appreciate your time & work! I have forwarded your reply in detail to FluxStore Team. If they have any more questions i will contact you. I hope some fruitful outcome from this experiment.
abhijitpattil
ParticipantHi @Ernest,
FluxStore team is actively checking to integrate Ajax Search Pro with their app. They have one more question.
Hi, could you help to check with Ajax Search Pro to see if they could share the example of the URL when requesting via Postman ?
Please give me details! Thank you!
-
AuthorPosts