• Funnelkit Support

    (@supportfunnelkit)


    Hi team,

    I hope you all are having a great day.

    This is Pratik from the Funnelkit Support team. We are reaching out to get some information from you.
    We have a product called Funnelkit Automation, which helps customers automate their pre & post-purchase email flows and offers them some CRM capabilities.

    FKA has an abandoned cart feature that fetches the product names from the cart/checkout page and prints them in the email. We use Woo’s get_name() function for it. One of our mutual customers is using both plugins and is facing an issue with the translation of the product name.

    Their site’s base language is FRENCH, and they also have an additional language, German & they are using the TranslatePress plugin. The checkout page correctly shows the product name as per the language, however when we try to fetch it in our email, even though customer abandons from the German checkout page, the FRENCH product name gets printed in the email.

    French checkout page -> https://greenbeautysquare.com/boutique/concentre-hydratation-hydraboost/
    German checkout page -> https://greenbeautysquare.com/de/shop/hydraboost-feuchtigkeitskonzentrat-gel/

    When we fetch the product name from German checkout page, if prints the value shown in the French checkout page.

    To overcome this issue, we have written a snippet as given below,

    function get_translated_string( $string, $language ) {
    if ( empty( $string ) || empty( $language ) ) {
    return $string;
    }

    if ( class_exists( 'TRP_Translate_Press' ) ) {
    $trp = TRP_Translate_Press::get_trp_instance();
    $settings = $trp->get_component( 'settings' );
    $settings = $settings->get_settings();
    $default_language = $settings['default-language'];
    if ( $language === $default_language ) {
    return $string;
    }
    global $wpdb;
    $table = strtolower( "{$wpdb->prefix}trp_dictionary_{$default_language}_{$language}" );
    BWFAN_Common::pr( $table );
    $query = "SELECT
    translated FROM {$table} WHERE original='$string'";
    BWFAN_Common::pr( $query );
    $value = $wpdb->get_var( $query );

    return empty( $value ) ? $string : $value;
    }

    return $string;
    }

    We wanted your opinion to see if this is correct or if you have any better idea. We are looking forward to your response.

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

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support Alex

    (@alexcozmoslabs)

    Hello,

    Thank you for reaching out to TranslatePress support.

    Your code snippet looks sound, but we recommend using the ‘translate_string’ function from TranslatePress instead for a more efficient and clean solution.

    I hope that helps. Please don’t hesitate to ask if you have more questions.

    Kind Regards,

    Thread Starter Funnelkit Support

    (@supportfunnelkit)

    HI,

    Thanks for the reply.

    You recommend using the ‘translate_string’ function method from the TranslatePress. However, we see that the method is not available in the repo plugin v2.8.1.

    In this case, can you please provide any references? Let us know your thoughts.

    Thread Starter Funnelkit Support

    (@supportfunnelkit)

    Hi there,

    We are following up as it’s been a while since we received any response from the TranslatePress support team.

    Given the urgency of our situation, we would greatly appreciate an update on the status of our request. Our client’s website functionality is impacted, and we’re eager to resolve this as soon as possible.

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