Support » Plugin: Loco Translate » Can’t translate string in Functions.php

  • rpimpao

    (@rpimpao)


    Hello,

    I have this code in functions and I’ve tried everything written in this forum. I would like to translate “Teclado para hóspedes” into different languages but I can’t find how can I do that.

    add_action( 'woocommerce_review_order_before_submit', 'bbloomer_checkout_add_on', 9999 );
     
    function bbloomer_checkout_add_on() {
       $product_ids = array( 3876 );
       $in_cart = false;
       foreach( WC()->cart->get_cart() as $cart_item ) {
          $product_in_cart = $cart_item['product_id'];
          if ( in_array( $product_in_cart, $product_ids ) ) {
             $in_cart = true;
             break;
          }
       }
       if ( ! $in_cart ) {
      echo '<font size="4" color="black" margin-left"5">Teclado para hóspedes </font>';
          echo '<p><a class="button" style="margin-left: 1em; margin-right: 0.3em; width: auto;background-color: #d83564;color: white;vertical-align: text-bottom;font-weight:normal;" href="?add-to-cart=3876"> Adicionar +79,99€ </a></p>';   
       }
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.