wordpress - 出现在 Woocommerce 中所有产品页面上的自定义按钮
问题描述
我目前正在将此代码与特定产品挂钩,但该按钮似乎也出现在我网站上的所有其他产品中。
add_action('woocommerce_after_add_to_cart_button','additional_single_product_button');
function additional_single_product_button() {
$product_ids = is_single(871);
echo "<br>";
echo "<br>";
echo '<div>';
echo '<a data-type="inline" class="button alt" href="/contact-us/">Pay at Spa @ $218 nett</a>';
echo '</div>';}
这是我的网站: http: //offers.elements.com.sg/
请告知我如何为特定产品添加此按钮。谢谢你。
解决方案
推荐阅读
- c# - SqlBulkCopy 数据类型转换
- gradle - 由于资源“attr/mode”与配置的重复值,构建失败
- php - 除主页(laravel)外,所有页面都重定向了太多时间
- gitlab-ci - 使用服务:在 gitlab-ci 中进行编解码测试的 mysql 失败并显示“连接被拒绝”
- rust - 检查 Rust 中的整数溢出
- powershell - 将 csv 加载到 powershell 输出的脚本
- php - 将树转换为 PHP 中的完整路径列表
- python - 从折线图中删除小数点
- php - 无法访问 Laravel 模型中的属性
- r - 闪亮的 renderUI 只显示最后一个输出