Skip to content

Instantly share code, notes, and snippets.

@jameskoster
Created October 7, 2013 21:24
Show Gist options
  • Star 8 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save jameskoster/6875202 to your computer and use it in GitHub Desktop.
Save jameskoster/6875202 to your computer and use it in GitHub Desktop.
WooCommerce - add text after price
add_filter( 'woocommerce_get_price_html', 'custom_price_message' );
function custom_price_message( $price ) {
$vat = ' (plus VAT)';
return $price . $vat;
}
@BatRTiago
Copy link

BatRTiago commented Feb 21, 2019

Hi,

For simple product, i try this code:

add_filter( 'woocommerce_get_price_html', 'custom_price_message' );
function custom_price_message( $price ) {
global $product;

// Limit to a specific product ID only (Set your product ID below )
if( $product->get_id() != 168 ) return;

// The content start below (with translatables texts)
?>
<?php
$vat = ' TTC/unitaire';
return $price . $vat;

}

@Gauravrana6999
Copy link

Hi,
can you please tell me how can I show the text ((*Incl. of all taxes) after a price on a single product page(wordpress) not is all product pages or in category pages? I just want to show this on a single product page.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment