• Resolved frangoaoalho

    (@frangoaoalho)


    Dear Fibosearch Team, I hope to find you well.

    For me to prevent something to get translated by GTranslate, i use JQuery to adjoin the .notranslate class to the element that I want to avoid getting translated.

    Now, I have tried to adjoin the .notranslate to a bunch of selectors, and none work.

    I want it to stop translating product names within the Dgwcas dropping boxes.

    Appreciated, Regards,

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support Kris

    (@c0nst)

    Hi @frangoaoalho!

    Here is a code snippet that will add a notranslate class to FiboSearch product titles in the autocomplete list and Details Panel to present them with original names.

    add_action( 'wp_footer', function() { ?>
    <script type="text/javascript">
    jQuery(document).on( 'fibosearch/show-suggestions', ($) => {
    jQuery('.dgwt-wcas-st-title').addClass('notranslate');
    } );
    </script>
    <?php }, 9999 );

    add_filter( 'dgwt/wcas/suggestion_details/product/html', function($html){
    $html = str_replace( 'dgwt-wcas-details-product-title', 'dgwt-wcas-details-product-title notranslate', $html );

    return $html;
    }, 10 );

    add_filter( 'dgwt/wcas/suggestion_details/term/html', function( $html ) {
    $html = str_replace( 'dgwt-wcas-tpd-rest-title', 'dgwt-wcas-tpd-rest-title notranslate', $html );

    return $html;
    }, 10 );

    You have two ways to add this code to your theme:

    1. Open the?functions.php?in your child theme and add the code at the end.
    2. or install the?Code Snippets?plugin and apply this code as a snippet.

    Regards,
    Kris

    Thread Starter frangoaoalho

    (@frangoaoalho)

    Dear Kris, I hope to find you well.

    Really appreciate your help. I am actually using CodeSnippets and it worked.|

    Many thanks Kris,

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.