Change Checkout heading text for virtual product !
-
This code change heading text for targetted product on checkout page, but i want to change heading text for virtual product on checkout page. How can i get this. Thx for your replay.
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 = 2969; // Loop through cart items foreach( WC()->cart->get_cart() as $cart_item ) { if( $targeted_product_id == $cart_item['data']->get_id() ) return __( 'Hello', $domain ); } } return $translated; }
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Change Checkout heading text for virtual product !’ is closed to new replies.