Change Checkout “Billing Details” text for a specific product in WoocommerceReference — What does this symbol mean in PHP?Reference - What does this error mean in PHP?How to make Woocommerce not to save Checkout billing fieldsWooCommerce checkout page change Your order details Shipping textChange Checkout “Place Order” text if cart has a specific productBilling address changes not changing on checkout page - WooCommerceWooCommerce order details after checkout pageUnset billing state checkout field for all countries except specific ones in WoocommerceChange wording on Woocommerce Checkout page

How do you manage to study and have a balance in your life at the same time?

Powering an offset stacked array of pistons

Punishment in pacifist society

What happens when there is no available physical memory left for SQL Server?

What is the most likely cause of short, quick, and useless reviews?

Time to call the bluff

What happens if I double Meddling Mage's 'enter the battlefield' trigger?

How can I oppose my advisor granting gift authorship to a collaborator?

Why didn't Thatcher give Hong Kong to Taiwan?

Can a country avoid prosecution for crimes against humanity by denying it happened?

Adding transparency to ink drawing

The little bee buzzes around the flower garden

Inverse of nth power of a linear transformation

Does secure hashing imply secure symmetric encryption?

How to find better food in airports

How many days for hunting?

What does "se jouer" mean here?

Tiny image scraper for xkcd.com

When is it legal to castle moving the rook first?

Why do many programmers abstain from using global variables?

Case Studies and Real Problems for Teaching Optimization and Modelling

Why did the Joi advertisement trigger K?

A rather curious equality: is this true?

Has Rey's new lightsaber been seen before in canon or legends?



Change Checkout “Billing Details” text for a specific product in Woocommerce


Reference — What does this symbol mean in PHP?Reference - What does this error mean in PHP?How to make Woocommerce not to save Checkout billing fieldsWooCommerce checkout page change Your order details Shipping textChange Checkout “Place Order” text if cart has a specific productBilling address changes not changing on checkout page - WooCommerceWooCommerce order details after checkout pageUnset billing state checkout field for all countries except specific ones in WoocommerceChange wording on Woocommerce Checkout page






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








-2















How can I change the text "Billing Details" in Woocommerce checkout page only for a specific product?



I have tried:



/* Change the Billing Details checkout label to Your Details: */
function wc_billing_field_strings( $translated_text, $text, $domain )

switch ( $translated_text )
case 'Billing Details' :
$translated_text = __( 'Your Details', 'woocommerce' );
break;

return $translated_text;

add_filter( 'gettext', 'wc_billing_field_strings', 20, 3 );


But it's changing the text for all products… How could I do this for one specific product?










share|improve this question





















  • 2





    We are unable to answer question like this, there are no details, no code attached. What framework are you using? What is the context?

    – Jirka Vrba
    Mar 28 at 5:24

















-2















How can I change the text "Billing Details" in Woocommerce checkout page only for a specific product?



I have tried:



/* Change the Billing Details checkout label to Your Details: */
function wc_billing_field_strings( $translated_text, $text, $domain )

switch ( $translated_text )
case 'Billing Details' :
$translated_text = __( 'Your Details', 'woocommerce' );
break;

return $translated_text;

add_filter( 'gettext', 'wc_billing_field_strings', 20, 3 );


But it's changing the text for all products… How could I do this for one specific product?










share|improve this question





















  • 2





    We are unable to answer question like this, there are no details, no code attached. What framework are you using? What is the context?

    – Jirka Vrba
    Mar 28 at 5:24













-2












-2








-2


1






How can I change the text "Billing Details" in Woocommerce checkout page only for a specific product?



I have tried:



/* Change the Billing Details checkout label to Your Details: */
function wc_billing_field_strings( $translated_text, $text, $domain )

switch ( $translated_text )
case 'Billing Details' :
$translated_text = __( 'Your Details', 'woocommerce' );
break;

return $translated_text;

add_filter( 'gettext', 'wc_billing_field_strings', 20, 3 );


But it's changing the text for all products… How could I do this for one specific product?










share|improve this question
















How can I change the text "Billing Details" in Woocommerce checkout page only for a specific product?



I have tried:



/* Change the Billing Details checkout label to Your Details: */
function wc_billing_field_strings( $translated_text, $text, $domain )

switch ( $translated_text )
case 'Billing Details' :
$translated_text = __( 'Your Details', 'woocommerce' );
break;

return $translated_text;

add_filter( 'gettext', 'wc_billing_field_strings', 20, 3 );


But it's changing the text for all products… How could I do this for one specific product?







php wordpress woocommerce checkout gettext






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 28 at 22:54









LoicTheAztec

110k15 gold badges92 silver badges132 bronze badges




110k15 gold badges92 silver badges132 bronze badges










asked Mar 28 at 2:48









javierjavier

224 bronze badges




224 bronze badges










  • 2





    We are unable to answer question like this, there are no details, no code attached. What framework are you using? What is the context?

    – Jirka Vrba
    Mar 28 at 5:24












  • 2





    We are unable to answer question like this, there are no details, no code attached. What framework are you using? What is the context?

    – Jirka Vrba
    Mar 28 at 5:24







2




2





We are unable to answer question like this, there are no details, no code attached. What framework are you using? What is the context?

– Jirka Vrba
Mar 28 at 5:24





We are unable to answer question like this, there are no details, no code attached. What framework are you using? What is the context?

– Jirka Vrba
Mar 28 at 5:24












2 Answers
2






active

oldest

votes


















2
















To change a translatable text in checkout page when there is a specific item in cart, use the following:



add_filter( 'gettext', 'change_conditionally_checkout_heading_text', 10, 3 );
function change_conditionally_checkout_heading_text( $translated, $text, $domain )
if( $text === 'Billing details' && is_checkout() && ! is_wc_endpoint_url() )
// HERE set the desired specific product ID
$targeted_product_id = 1980;

// Loop through cart items
foreach( WC()->cart->get_cart() as $cart_item )
if( $targeted_product_id == $cart_item['data']->get_id() )
return __( 'Your Details', $domain );


return $translated;



Code goes in function.php file of your active child theme (or active theme). Tested and works.




Note: In Woocommerce checkout the text to change is "Billing details" without a capital in "Details"







share|improve this answer


































    0
















    First, override the Woocommerce plugin template and change inside it
    wp-content/plugins/woocommerce/templates/checkout/form-checkout.php



    find your necessary template and change the text.






    share|improve this answer



























      Your Answer






      StackExchange.ifUsing("editor", function ()
      StackExchange.using("externalEditor", function ()
      StackExchange.using("snippets", function ()
      StackExchange.snippets.init();
      );
      );
      , "code-snippets");

      StackExchange.ready(function()
      var channelOptions =
      tags: "".split(" "),
      id: "1"
      ;
      initTagRenderer("".split(" "), "".split(" "), channelOptions);

      StackExchange.using("externalEditor", function()
      // Have to fire editor after snippets, if snippets enabled
      if (StackExchange.settings.snippets.snippetsEnabled)
      StackExchange.using("snippets", function()
      createEditor();
      );

      else
      createEditor();

      );

      function createEditor()
      StackExchange.prepareEditor(
      heartbeatType: 'answer',
      autoActivateHeartbeat: false,
      convertImagesToLinks: true,
      noModals: true,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: 10,
      bindNavPrevention: true,
      postfix: "",
      imageUploader:
      brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
      contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
      allowUrls: true
      ,
      onDemand: true,
      discardSelector: ".discard-answer"
      ,immediatelyShowMarkdownHelp:true
      );



      );













      draft saved

      draft discarded


















      StackExchange.ready(
      function ()
      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55389458%2fchange-checkout-billing-details-text-for-a-specific-product-in-woocommerce%23new-answer', 'question_page');

      );

      Post as a guest















      Required, but never shown

























      2 Answers
      2






      active

      oldest

      votes








      2 Answers
      2






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes









      2
















      To change a translatable text in checkout page when there is a specific item in cart, use the following:



      add_filter( 'gettext', 'change_conditionally_checkout_heading_text', 10, 3 );
      function change_conditionally_checkout_heading_text( $translated, $text, $domain )
      if( $text === 'Billing details' && is_checkout() && ! is_wc_endpoint_url() )
      // HERE set the desired specific product ID
      $targeted_product_id = 1980;

      // Loop through cart items
      foreach( WC()->cart->get_cart() as $cart_item )
      if( $targeted_product_id == $cart_item['data']->get_id() )
      return __( 'Your Details', $domain );


      return $translated;



      Code goes in function.php file of your active child theme (or active theme). Tested and works.




      Note: In Woocommerce checkout the text to change is "Billing details" without a capital in "Details"







      share|improve this answer































        2
















        To change a translatable text in checkout page when there is a specific item in cart, use the following:



        add_filter( 'gettext', 'change_conditionally_checkout_heading_text', 10, 3 );
        function change_conditionally_checkout_heading_text( $translated, $text, $domain )
        if( $text === 'Billing details' && is_checkout() && ! is_wc_endpoint_url() )
        // HERE set the desired specific product ID
        $targeted_product_id = 1980;

        // Loop through cart items
        foreach( WC()->cart->get_cart() as $cart_item )
        if( $targeted_product_id == $cart_item['data']->get_id() )
        return __( 'Your Details', $domain );


        return $translated;



        Code goes in function.php file of your active child theme (or active theme). Tested and works.




        Note: In Woocommerce checkout the text to change is "Billing details" without a capital in "Details"







        share|improve this answer





























          2














          2










          2









          To change a translatable text in checkout page when there is a specific item in cart, use the following:



          add_filter( 'gettext', 'change_conditionally_checkout_heading_text', 10, 3 );
          function change_conditionally_checkout_heading_text( $translated, $text, $domain )
          if( $text === 'Billing details' && is_checkout() && ! is_wc_endpoint_url() )
          // HERE set the desired specific product ID
          $targeted_product_id = 1980;

          // Loop through cart items
          foreach( WC()->cart->get_cart() as $cart_item )
          if( $targeted_product_id == $cart_item['data']->get_id() )
          return __( 'Your Details', $domain );


          return $translated;



          Code goes in function.php file of your active child theme (or active theme). Tested and works.




          Note: In Woocommerce checkout the text to change is "Billing details" without a capital in "Details"







          share|improve this answer















          To change a translatable text in checkout page when there is a specific item in cart, use the following:



          add_filter( 'gettext', 'change_conditionally_checkout_heading_text', 10, 3 );
          function change_conditionally_checkout_heading_text( $translated, $text, $domain )
          if( $text === 'Billing details' && is_checkout() && ! is_wc_endpoint_url() )
          // HERE set the desired specific product ID
          $targeted_product_id = 1980;

          // Loop through cart items
          foreach( WC()->cart->get_cart() as $cart_item )
          if( $targeted_product_id == $cart_item['data']->get_id() )
          return __( 'Your Details', $domain );


          return $translated;



          Code goes in function.php file of your active child theme (or active theme). Tested and works.




          Note: In Woocommerce checkout the text to change is "Billing details" without a capital in "Details"








          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Mar 30 at 10:16

























          answered Mar 28 at 22:50









          LoicTheAztecLoicTheAztec

          110k15 gold badges92 silver badges132 bronze badges




          110k15 gold badges92 silver badges132 bronze badges


























              0
















              First, override the Woocommerce plugin template and change inside it
              wp-content/plugins/woocommerce/templates/checkout/form-checkout.php



              find your necessary template and change the text.






              share|improve this answer





























                0
















                First, override the Woocommerce plugin template and change inside it
                wp-content/plugins/woocommerce/templates/checkout/form-checkout.php



                find your necessary template and change the text.






                share|improve this answer



























                  0














                  0










                  0









                  First, override the Woocommerce plugin template and change inside it
                  wp-content/plugins/woocommerce/templates/checkout/form-checkout.php



                  find your necessary template and change the text.






                  share|improve this answer













                  First, override the Woocommerce plugin template and change inside it
                  wp-content/plugins/woocommerce/templates/checkout/form-checkout.php



                  find your necessary template and change the text.







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Mar 28 at 7:25









                  MANOJ VASHISTMANOJ VASHIST

                  194 bronze badges




                  194 bronze badges






























                      draft saved

                      draft discarded
















































                      Thanks for contributing an answer to Stack Overflow!


                      • Please be sure to answer the question. Provide details and share your research!

                      But avoid


                      • Asking for help, clarification, or responding to other answers.

                      • Making statements based on opinion; back them up with references or personal experience.

                      To learn more, see our tips on writing great answers.




                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function ()
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55389458%2fchange-checkout-billing-details-text-for-a-specific-product-in-woocommerce%23new-answer', 'question_page');

                      );

                      Post as a guest















                      Required, but never shown





















































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown

































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown







                      Popular posts from this blog

                      SQL error code 1064 with creating Laravel foreign keysForeign key constraints: When to use ON UPDATE and ON DELETEDropping column with foreign key Laravel error: General error: 1025 Error on renameLaravel SQL Can't create tableLaravel Migration foreign key errorLaravel php artisan migrate:refresh giving a syntax errorSQLSTATE[42S01]: Base table or view already exists or Base table or view already exists: 1050 Tableerror in migrating laravel file to xampp serverSyntax error or access violation: 1064:syntax to use near 'unsigned not null, modelName varchar(191) not null, title varchar(191) not nLaravel cannot create new table field in mysqlLaravel 5.7:Last migration creates table but is not registered in the migration table

                      용인 삼성생명 블루밍스 목차 통계 역대 감독 선수단 응원단 경기장 같이 보기 외부 링크 둘러보기 메뉴samsungblueminx.comeh선수 명단용인 삼성생명 블루밍스용인 삼성생명 블루밍스ehsamsungblueminx.comeheheheh

                      155 수학 과학 기타 둘러보기 메뉴eh추가해eh문서를 완성해