Skip to content

Instantly share code, notes, and snippets.

@bekarice
Created January 4, 2016 00:23
Show Gist options
  • Select an option

  • Save bekarice/0a148c189bdeccd187d9 to your computer and use it in GitHub Desktop.

Select an option

Save bekarice/0a148c189bdeccd187d9 to your computer and use it in GitHub Desktop.
Add labels to WooCommerce Product price
<?php
// only copy opening php tag if needed
// Adds "per package" after each product price throughout the shop
function sv_change_product_price_display( $price ) {
$price .= ' per package';
return $price;
}
add_filter( 'woocommerce_get_price_html', 'sv_change_product_price_display' );
add_filter( 'woocommerce_cart_item_price', 'sv_change_product_price_display' );
@stephgeoff
Copy link
Copy Markdown

Hi, can i ask you where to add this code, i try to figure out with the editor, dont find wc-product-price-display.php file.
I suppose i have to create it and add it inside the woocommerce plugin folders? Or i have to edit an existing files?

@captainkarlcod
Copy link
Copy Markdown

Can you explain, where to put this?

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