Viewing 12 replies - 1 through 12 (of 12 total)
  • Hello

    Check option – https://clip2net.com/s/3F3rMkD

    Если Вы знаете русский язык и Вам удобно, можете писать на нем.

    Thread Starter NibbleByte

    (@nibblebyte)

    Found the option:
    “In the terms slugs uses non-latin characters”
    It was already “yes”. It still doesn’t work…

    Sorry, I’m Bulgarian, so I don’t understand Russian ??

    Plugin Author RealMag777

    (@realmag777)

    Hello

    I just did experiments and understood that deal is in case-sensitive for Cyrillic symbols, so try to rename ‘Мистериум’ to ‘мистериум OR
    * open wp-content\plugins\woocommerce-products-filter-free\ext\by_text\index.php
    * find public function woof_post_text_filter
    * replace $woof_text = trim(WOOF_HELPER::strtolower($woof_text)); to $woof_text = trim(($woof_text));
    * after $woof_text = str_replace(' ', '?(.*)', $woof_text); add $woof_text = '[[:<:]]' . $woof_text . '[[:>:]]';

    Works for me:
    * https://www.demo.woocommerce-filter.com/?swoof=1&woof_text=%D0%BF%D1%80%D0%B8%D0%B2%D0%B5%D1%82
    * https://www.demo.woocommerce-filter.com/?s=%D0%BF%D1%80%D0%B8%D0%B2%D0%B5%D1%82

    +

    another way:
    * open wp-content\plugins\woocommerce-products-filter-free\ext\by_text\index.php
    * find public function woof_get_request_data($request)
    * remove $request['woof_text'] = $request['s'];

    • This reply was modified 8 years, 3 months ago by RealMag777.
    • This reply was modified 8 years, 3 months ago by RealMag777.
    Thread Starter NibbleByte

    (@nibblebyte)

    It still doesn’t work for me.

    The first solution totally breaks the search and nothing can be found with it.

    The second fixes the search when searching at the top right search bar (that comes with the WooCommerce theme). Searching there for “миш” and “мист” works as expected.
    But trying to search in the search filter still doesn’t work with cyrillic. ??

    Try it now…
    https://mulliganclub.net/shop/

    • This reply was modified 8 years, 3 months ago by NibbleByte.
    • This reply was modified 8 years, 3 months ago by NibbleByte.

    Hello @nibblebyte

    Try it
    * open wp-content\plugins\woocommerce-products-filter-free\ext\by_text\index.php
    * find public function woof_post_text_filter

    Add this “LOWER” ( https://clip2net.com/s/3FdVB6s )

    Plugin Author RealMag777

    (@realmag777)

    Here is code block for replacing:

    switch ($behavior)
    {
        case 'content':
            $where.= "AND LOWER(post_content) REGEXP '{$woof_text}'";
            break;
    
        case 'title_or_content':
            $where.= "AND ( LOWER(post_title)post_title REGEXP '{$woof_text}' OR post_content REGEXP '{$woof_text}')";
            break;
    
        case 'title_and_content':
            $where.= "AND (LOWER(post_title) REGEXP '{$woof_text}' AND post_content REGEXP '{$woof_text}')";
            break;
    
        case 'excerpt':
            $where.= "AND LOWER(post_excerpt) REGEXP '{$woof_text}'";
            break;
    
        case 'content_or_excerpt':
            $where.= "AND (LOWER(post_excerpt) REGEXP '{$woof_text}' OR post_content REGEXP '{$woof_text}')";
            break;
    
        case 'title_or_content_or_excerpt':
            $where.= "AND ((LOWER(post_title) REGEXP '{$woof_text}') OR (post_excerpt REGEXP '{$woof_text}') OR (post_content REGEXP '{$woof_text}'))";
            break;
    
        default:
            //only by title
            $where.= "AND LOWER(post_title) REGEXP '{$woof_text}'";
            break;
    }
    • This reply was modified 8 years, 3 months ago by RealMag777.
    Thread Starter NibbleByte

    (@nibblebyte)

    Good news… this one fixes the bug ??

    But now I have another problem. I’ve updated the plugin and it doesn’t search for parts in the words in titles (for any language, not just Cyrillic).
    Again, test here: https://mulliganclub.net/shop/
    We have an item called “Мистериум (Mysterium)”. Here are some search results:
    – мистериум – OK (case-insensitive, full word)
    – Мист – Finds nothing
    – mysterium – OK (case-insensetive, full word)
    – Myst – Finds nothing

    Hello @nibblebyte

    If you pasted this code(in wp-content\plugins\woocommerce-products-filter-free\ext\by_text\index.php): $woof_text = '[[:<:]]' . $woof_text . '[[:>:]]'; remove it. Because it is to search for whole words.

    Thread Starter NibbleByte

    (@nibblebyte)

    That fixes it, yes.

    But I think I didn’t paste that code, especially because it has comment above it:

    
    //https://dev.mysql.com/doc/refman/5.7/en/regexp.html
    $woof_text = '[[:<:]]' . $woof_text . '[[:>:]]';
    

    After the update all changes made by me should have been wiped out. So I believe this is in production right now. Soo it should be fixed? ??

    Thanks a lot for the help ??

    Hello @nibblebyte

    This will be fixed in the next update.

    Plugin Author RealMag777

    (@realmag777)

    Welcome ?? …

    I will make option for that code $woof_text = '[[:<:]]' . $woof_text . '[[:>:]]'; as it allows searching by whole words only, so its feature, but looks like not for all its nessesary …

    Thread Starter NibbleByte

    (@nibblebyte)

    Great ??

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘Searching for product name in cyrillic doesn’t work’ is closed to new replies.