Untitled
unknown
plain_text
2 years ago
1.1 kB
4
Indexable
function custom_text_change_script() {
if ( is_checkout() ) {
?>
<script type="text/javascript">
jQuery(document).ready(function($) {
// Función para realizar la corrección de texto
function performTextCorrection() {
// Reemplaza el texto en el bloque de revisión del checkout
$('.woocommerce-checkout-review-order-table .product-name strong:contains("Inserisci la larghezza (m):")').each(function() {
$(this).text($(this).text().replace('Inserisci la larghezza (m):', 'Larghezza:'));
});
}
// Ejecuta la corrección de texto al cargar la página inicialmente y después de la actualización del bloque de revisión del checkout
performTextCorrection();
$(document.body).on('updated_checkout', performTextCorrection);
});
</script>
<?php
}
}
add_action('wp_footer', 'custom_text_change_script');
Editor is loading...