如何解决在woocommerce中的单个产品摘要上回显自定义运输类别标题
在woocommerce中添加到购物车按钮后,我试图在单个产品页面上呼应自定义送货的标题。
我从这里(https://code.tutsplus.com/tutorials/create-a-custom-shipping-method-for-woocommerce--cms-26098)使用了自定义的运输类插件。
我可以在购物车页面上显示标题,但不能在单个产品页面上显示。
使用上述功能:
add_action('woocommerce_single_product_summary','echo_shipping_title',35);
function echo_shipping_title(){
$ttl = $this->title;
$ttlg = get_option('title');
$TutsPlus_Shipping_Method = new TutsPlus_Shipping_Method();
$ttlt = $TutsPlus_Shipping_Method->title;
echo $ttl; //failed
echo $ttlg; // also failed
echo $ttlt; // also failed
}
我可以钩在购物车页面上,但不能钩在产品页面上!
我不知道自己在哪里做错了!
任何帮助表示赞赏。
谢谢
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。