Skip to content

Instantly share code, notes, and snippets.

Last active Aug 30, 2019
What would you like to do?
WooCommerce Checkout Add-ons - Enable WPML translation of labels, names, and options
function sv_wc_checkout_add_ons_wpml_translate( $label ) {
return apply_filters( 'translate_string', $label, 'woocommerce-checkout-add-ons', $label );
add_filter( 'woocommerce_checkout_add_on_get_name', 'sv_wc_checkout_add_ons_wpml_translate' );
add_filter( 'woocommerce_checkout_add_on_get_label', 'sv_wc_checkout_add_ons_wpml_translate' );
function sv_wc_checkout_add_ons_options_wpml_translate( $options ) {
$translated_options = array();
foreach ( $options as $option ) {
$option['label'] = apply_filters( 'translate_string', $option['label'], 'woocommerce-checkout-add-ons', $option['label'] );
$translated_options[] = $option;
return $translated_options;
add_filter( 'woocommerce_checkout_add_on_get_options', 'sv_wc_checkout_add_ons_options_wpml_translate' );
Copy link

forlini commented Oct 8, 2015

Can't get them to register, do I need to change something in the functions file?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment