Created
December 31, 2019 16:22
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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