Your account expired support, please renew to get your support.

HomePage Forums Themes Support Umimo – Furniture Store WordPress Theme Search for not just portfolios, but also portfolio categories

Viewing 15 posts - 1 through 15 (of 24 total)
  • Author
    Posts
  • #28894
    hmkitchen
    Support 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.

    search result

    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();
        }
    #28931

    Hello,

    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 function

    #29056
    hmkitchen
    Support Expired

    Hi 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 be post_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.
    #29087

    Hello,

    #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.

    #29119
    hmkitchen
    Support Expired

    Hi,

    #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 and portfolio 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?

    #29132
    This reply has been marked as private.
    #29147
    hmkitchen
    Support Expired

    Hi,

    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 is post_type=portfolio, but the desired outcome should be post_type=product since the portfolio has been renamed to product 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!

    #29154

    Hi,

    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.

    #29162
    hmkitchen
    Support Expired

    Hi,

    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 category

    Or you could also suggest what can be done with this $41.13.

    #29164
    This reply has been marked as private.
    #29221
    hmkitchen
    Support Expired
    This reply has been marked as private.
    #29222
    hmkitchen
    Support Expired

    If 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!

    #29227
    This reply has been marked as private.
    #29231
    hmkitchen
    Support Expired

    Hi,

    Alright, sounds good. May I know what will be the estimated completion date?

    • This reply was modified 2 years ago by hmkitchen.
    #29256
    hmkitchen
    Support Expired

    Hi,

    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!

Viewing 15 posts - 1 through 15 (of 24 total)

You must be logged in to reply to this topic.