admin管理员组文章数量:1426462
i create a button in a current product page after woocommerce_single_product_summary
i would to get information about the current product ( for example name and price) and through the button send an email for get information
this is the code of my functions.php file:
add_action( 'woocommerce_single_product_summary','content_after_addtocart_button' );
function content_after_addtocart_button() {
echo '<div class="content-section">
<a href="mailto:[email protected]?&subject= Richiesta Informazioni&body= product name ??? product price ??? ">
<input type="button" value="Richiedi Informazioni"/ ></a></div>';
}
anyone can help me ?
i create a button in a current product page after woocommerce_single_product_summary
i would to get information about the current product ( for example name and price) and through the button send an email for get information
this is the code of my functions.php file:
add_action( 'woocommerce_single_product_summary','content_after_addtocart_button' );
function content_after_addtocart_button() {
echo '<div class="content-section">
<a href="mailto:[email protected]?&subject= Richiesta Informazioni&body= product name ??? product price ??? ">
<input type="button" value="Richiedi Informazioni"/ ></a></div>';
}
anyone can help me ?
Share Improve this question asked Jun 13, 2019 at 0:37 riccardo aironericcardo airone 1131 silver badge4 bronze badges1 Answer
Reset to default 1Please check below code :
add_action( 'woocommerce_single_product_summary','content_after_addtocart_button' );
function content_after_addtocart_button() {
global $product;
$product_title = $product->get_name();
$product_price = $product->get_price();
echo '<div class="content-section">
<a href="mailto:[email protected]?&subject=Richiesta Informazioni&body=' . $product_title . '??? ' . $product_price . ' ??? ">
<input type="button" value="Richiedi Informazioni"/ ></a></div>';
}
本文标签: get current product name in functionsphp
版权声明:本文标题:get current product name in functions.php 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745406772a2657284.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论