/** * Renombrar "Total" -> "Total a pagar ahora" en todos los sub-sitios (no en el sitio principal). */ // Helper: estamos en multisite y NO en el sitio principal (blog_id 1) function rt_is_subsite_not_main() { return function_exists('is_multisite') && is_multisite() && function_exists('get_current_blog_id') && (int) get_current_blog_id() !== 1; } // 1) Carrito / Checkout (fila de totales en la tabla del pedido) add_filter('gettext', function ($translated, $text, $domain) { if ( rt_is_subsite_not_main() && !is_admin() && $domain === 'woocommerce' && $text === 'Total' && ( function_exists('is_cart') && is_cart() || function_exists('is_checkout') && is_checkout() || function_exists('is_wc_endpoint_url') && is_wc_endpoint_url('order-pay') ) ) { return 'Total a pagar ahora'; } return $translated; }, 999, 3); // 2) Resumen de pedido (gracias, mi cuenta, emails) add_filter('woocommerce_get_order_item_totals', function ($totals, $order, $tax_display) { if (rt_is_subsite_not_main() && isset($totals['order_total']['label'])) { $totals['order_total']['label'] = 'Total a pagar ahora'; } return $totals; }, 20, 3);