Skip to content

Instantly share code, notes, and snippets.

@webdados
Created December 31, 2019 16:22
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 webdados/dbc8c634cddd2c94e69901d35b55e95a to your computer and use it in GitHub Desktop.
Save webdados/dbc8c634cddd2c94e69901d35b55e95a to your computer and use it in GitHub Desktop.
Customize the "Product Assembly / Gift Wrap / ... Cost for WooCommerce" message on each product page
<?php
add_filter( 'product_assembly_cost_message', 'my_product_assembly_cost_message', 10, 2 );
function my_product_assembly_cost_message( $message, $product ) {
//Message on the settings: "{checkbox} Request assembly of {product} for {price}? {link}"
$message = str_replace(
'{product}',
$product->get_title(),
$message
);
$message = str_replace(
'{link}',
'<a href="https://www.info.com">More information here</a>',
$message
);
return $message;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment