woocommercehook-woocommerce

Woocommerce checkout breadcrumbs


I am using woocommerce with flatsome theme. My website is in Spanish, and I am quite happy with how its translated automatically, but I have one issue. The checkout has the breadcrumbs in English. Any way I can add a snippet to change;

Shopping cart -> Carrito
Checkout details -> Detalles de pago
Order complete -> Pedido completado

Thanks

breadcrumb image


Solution

  • Ok, I found out how to do it, I hope this can help someone else;

    add_filter( 'gettext', function ( $strings ) {
        /**
         * Holding translations/changes.
         * 'to translate' => 'the translation or rewording'
         */
        $text = array(
            'SHOPPING CART' => 'CARRITO',
            'CHECKOUT DETAILS'   => 'DETALLES DE PAGO',
            'ORDER COMPLETE'   => 'PAGO COMPLETADO',
        );
    
        $strings = str_ireplace( array_keys( $text ), $text, $strings );
    
        return $strings;
    }, 20 );