在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 (将#修改为@)

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...