Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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