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;
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
add a comment |
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
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
add a comment |
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
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
php wordpress woocommerce checkout gettext
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
add a comment |
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
add a comment |
2 Answers
2
active
oldest
votes
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"
add a comment |
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.
add a comment |
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
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
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"
add a comment |
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"
add a comment |
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"
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"
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
add a comment |
add a comment |
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.
add a comment |
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.
add a comment |
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.
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.
answered Mar 28 at 7:25
MANOJ VASHISTMANOJ VASHIST
194 bronze badges
194 bronze badges
add a comment |
add a comment |
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.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
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