Skip to content

Instantly share code, notes, and snippets.

@mikejolley
Created January 3, 2012 11:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mikejolley/1554483 to your computer and use it in GitHub Desktop.
Save mikejolley/1554483 to your computer and use it in GitHub Desktop.
WooCommerce - A filter to add product links to order emails
/* Add this code to functions.php of your theme */
add_filter('woocommerce_order_product_title', 'custom_order_product_title', 10, 2);
function custom_order_product_title( $name, $product ) {
if ($product->id) return '<a href="'.home_url( '?p=' . $product->id ).'">'. $name .'</a>';
return $name;
}
@outofhouse
Copy link

Great - works like a dream!

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