Example of snippet to translate your checkout element (override/added by the Funnel Builder plugin)

add_filter('woocommerce_update_order_review_fragments', 'wg_update_checkout', 999, 2);
function wg_update_checkout($arr) {
$pdf_translate_service = weglot_get_service( 'Pdf_Translate_Service_Weglot' );
$original_lang = weglot_get_original_language();
$current_language = weglot_get_current_language();
if ( $original_lang == $current_language ) {
	return $arr;
}
$pot = $pdf_translate_service->translate_pdf( $arr['place_order_text'], $current_language );
$arr['place_order_text'] = $pot['content'];
return $arr;
}

Last updated