HomePage › Forums › Themes Support › Umimo – Furniture Store WordPress Theme › Search for not just portfolios, but also portfolio categories
- This topic has 23 replies, 2 voices, and was last updated 1 year, 12 months ago by Billy Nguyen.
-
AuthorPosts
-
November 2, 2022 at 3:51 pm #28894hmkitchenSupport Expired
Hi, may I ask how do i modify the
function umimo_ajax_search_products()
so that it search for portfolio categories portfolios? Right now it only search for portfolios and it isn’t accurate, you may refer to the screenshot.This is my code in functions.php now:
function umimo_ajax_search_products() { $search_keyword = $_REQUEST['query']; $suggestions = array(); $args = array( 's' => apply_filters('umimo_ajax_search_products_search_query', $search_keyword), 'post_type' => 'umimo_portfolio', 'post_status' => 'publish', 'ignore_sticky_posts' => 1, 'posts_per_page' => apply_filters('umimo_ajax_search_products_posts_per_page', 8), ); $products = get_posts($args); if (!empty($products)) { foreach ($products as $post) { $product_image = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID)); $suggestions[] = apply_filters('umimo_suggestion', array( 'id' => $post->ID, 'value' => strip_tags($post->post_title), 'url' => get_permalink( $post->ID ), 'img' => esc_url($product_image[0]), ), $product); } } else { $suggestions[] = array( 'id' => -1, 'value' => esc_html__('No results', 'umimo'), 'url' => '', ); } wp_reset_postdata(); echo json_encode($suggestions); die(); }
November 3, 2022 at 10:31 am #28931Hello,
I see that the searches are still returning the correct results, your code has no problem either.
Of course the search results for single portfolio and not for portfolio.
If you want the search result to be the product category you will have to modify the search query in your functionNovember 8, 2022 at 2:40 pm #29056hmkitchenSupport ExpiredHi Billy, but if you look at the screenshot I sent there, I searched for meru valley but all portfolios showed up.
Another error is if I press enter on the keyboard in the search bar, it brings me to an error page. Apparently it is because that the parameter in the url is
post_type=product
and it should bepost_type=portfolio
. How can I fix this?Can I ask for your assist on modifying the code so that it can search for single portfolio and portfolio category? For example, if I search for a portfolio category, the search result will be whatever single portfolios that is in that category.
- This reply was modified 2 years ago by hmkitchen.
November 9, 2022 at 8:59 am #29087Hello,
#1. Search in portfolio titles, descriptions and keywords, not in portfolio titles.
#2. Yes, the primary search form is only for products, so to switch to portfolio search you have to customize the code.
Please rewrite function umimo_product_search in child-theme => edit post_type=product to post_type=portfolio.#3. You will have to code 1 more option to select the portfolio category + additional code to customize the search by portfolio category to return portfolios by the selected category.
If you need to customize this way, I will customize it for you, but you will have to pay for this customization.November 9, 2022 at 10:00 pm #29119hmkitchenSupport ExpiredHi,
#1. Then it might be reading the titles from the Related Projects section at the bottom of my single portfolio page. But I don’t want that tho, because that doesn’t make sense and it should search for just the matching title. How can I do that?
#2. May I ask where is the file that contains the function
umimo_product_search
located at? I could not find it in the parent theme.#3. Yeah I need the search function to be able to be searched by
portfolio category
andportfolio title
(not including portfolio content/description/keywords).Do let me know how much would the customization fee be, or can I straight extend the theme support to receive these customizations?
November 10, 2022 at 9:18 am #29132This reply has been marked as private.November 10, 2022 at 4:50 pm #29147hmkitchenSupport ExpiredHi,
I would like to have the initial bug fixed first as they were from a previous ticket. In case you forgot, the search codes in my functions.php now is written by you previously.
The bugs are:
#1. when I search for one portfolio, all other irrelevant portfolios appeared (should just search for portfolio title, because it does not makes sense if I search for one portfolio, every result came out).#2. when I hit enter on search, wrong url parameter
post_type=product
. The working one ispost_type=portfolio
, but the desired outcome should bepost_type=product
since the portfolio has been renamed toproduct
on previous request.After the bugs are fixed, we can proceed to the category customization. Also, I am just wondering that why couldn’t I extend the theme support license to continue to get support to finish this search function? Or does it has to be additional customization fee for it?
Please understand because actually I am trying to explain to my client the additional cost to top up to have this category search feature. But they are bugging about the current bugs not being fixed.
Thanks!
November 11, 2022 at 9:01 am #29154Hi,
This is not a bug of the theme!!!
Earlier, as I explained, this search form is a product search form and not a portfolio like you have customized.
Changing the search option to this post type portfolio has greatly distorted the search form. Therefore, you will have to customize the entire search code according to the post type of portfolio.
The customizations I’ve come up with to address all of the issues you might consider buggy include:
– Search portfolio only by title
– The search results page shows only portfolio
– Add search by portfolio category
Hope you can explain and convince your customers.November 11, 2022 at 11:05 am #29162hmkitchenSupport ExpiredHi,
I understand. Just earlier this week I have collected the payment of $41.13 from my client to extend theme support thinking that it could be fixed if I extend the theme support. So I am kind of in a predicament now to request once again.
So it would be great if you could separate into 3 costs for me:
1) extend theme support to address maybe the first and second point that you mentioned? – $41.13
2) to just do the Search portfolio only by title
3) to add search by portfolio categoryOr you could also suggest what can be done with this $41.13.
November 11, 2022 at 1:53 pm #29164This reply has been marked as private.November 14, 2022 at 12:15 pm #29221hmkitchenSupport ExpiredThis reply has been marked as private.November 14, 2022 at 12:19 pm #29222hmkitchenSupport ExpiredIf you are able to come down to $41.13, I will do the transfer by today.
If it is not possible, we will request from client but it will take quite some time as we will need to inform my client, prepare another invoice for it and for them to arrange the payment for the remaining $9.
Let me know 🙂
Thanks!November 14, 2022 at 1:24 pm #29227This reply has been marked as private.November 14, 2022 at 2:14 pm #29231hmkitchenSupport ExpiredHi,
Alright, sounds good. May I know what will be the estimated completion date?
- This reply was modified 2 years ago by hmkitchen.
November 15, 2022 at 12:36 am #29256hmkitchenSupport ExpiredHi,
Just want to let you know that I will be pushing the site Live tomorrow. So during ur customization, please try to not cause down time to the website.
Thanks!
-
AuthorPosts
You must be logged in to reply to this topic.