• Resolved tlouwet

    (@tlouwet)


    Plugin: Woocommerce
    Issue: Some products not showing

    Seems some variable products are not showing up on my search page when a secondary language is selected.
    Certain ones show up with no issue, for example all named “Expert …”.
    Certain ones don’t show up at all, for example all named “Bora …” or “Profi …”.

    They reappear once I disable Translatepress.

    The function have_posts() doesn’t find anything called “Bora” anymore…

    Is there a known fix to this?

Viewing 8 replies - 1 through 8 (of 8 total)
  • Thread Starter tlouwet

    (@tlouwet)

    Think I found the cause..
    Function: public function trp_search_filter( $query )
    Php-file: translatepress-multilingual/includes/class-search.php

    Two questions:
    – Is this a current bug?
    – Can I cancel out the code within that function, without messing something else up?
    – Does that function do anything else but changing wpquery for search pages?

    I had the same problem like you.
    For me the products which have also the categories or sub-categories with the same name doesn’t appear on search.

    I found a short way to fix this :

    I replace $dictionary_name = $this->trp_query->get_table_name( $TRP_LANGUAGE );

    with my default language
    $dictionary_name = $this->trp_query->get_table_name( “en” );
    and it worked for me.

    NOTE: I have the products in one language(the secondary language).

    Thread Starter tlouwet

    (@tlouwet)

    @enealila You legend!
    That fixed it ??
    Thanks.
    Do hope they’ll add it as a setting, so we don’t have to update the php file each time.

    Hi @enealila and @tlouwet,

    I’m facing the same issue, only some products showing, even though all are translated.

    Can you please tell me which php file you edited to achieve this?

    It’s ok. I found the file to edit, but When it is replaced with the above text, I get an error.

    Warning: Undefined constant use of “en” – considered as “en” (this sends Error to a future version of PHP) / homepages / 5 / d820635844 / htdocs / clickandbuilds / inncy / wp-content / plugins / translatepress-multilingual / includes / class-search.php 74 online

    Any ideas?

    Thread Starter tlouwet

    (@tlouwet)

    @tristantrx It would seem it does not know what “en” refers to, or that “en” is seen as a mistyped variable.
    Only thing I could think of is, do you have english a language with translatepress?

    $dictionary_name = $this->trp_query->get_table_name( “nl” );
    is what I have to use.
    Reason I’m using “nl” is because the main language of the website I had this issue with was Dutch, hence nl.

    @tlouwet Yes, I am using English as the main language.

    The weird thing is changing this line of code does fix the part of the issue where the woocommerce products were not showing, but now have this error and still cannot search products in the other language.

    I have contacted the Translatepress support about this, as I will need to purchase their pro version if it can work as expected.

    Hopefully they can find a fix and I’ll post here for others if they do.

    Thanks for your help ????

    Hello,

    I contacted the dev team on this issue and they informed me that in the next version this should be resolved.

    P.S – The search will work only if you are using the WP default search. if you are using a custom plugin it will not work properly. — It could get some results but not all of them.

    As I said earlier, this fix will be included in the next version. But if someone wants to use the fix brought in the next update right now, they can change it manually.

    This:
    $dictionary_name = $this->trp_query->get_table_name( $TRP_LANGUAGE );
    To this:
    $dictionary_name = $this->trp_query->get_table_name( apply_filters( 'trp_change_search_dictionary_language', $TRP_LANGUAGE, $this, $query ) );

    Best of regards,

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Woo – Some products not showing’ is closed to new replies.