Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/279.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/wordpress/11.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 在woocommerce中的单个产品摘要上回显自定义装运类标题_Php_Wordpress_Class_Woocommerce_Shipping - Fatal编程技术网

Php 在woocommerce中的单个产品摘要上回显自定义装运类标题

Php 在woocommerce中的单个产品摘要上回显自定义装运类标题,php,wordpress,class,woocommerce,shipping,Php,Wordpress,Class,Woocommerce,Shipping,我试图在woocommerce中的“添加到购物车”按钮之后,在单个产品页面上回应定制配送的标题 我在这里使用了定制的shipping类插件() 我可以在购物车页面回显标题,但无法在单个产品页面上回显标题 通过使用上述功能: add_action('woocommerce_single_product_summary','echo_shipping_title',35); function echo_shipping_title(){ $ttl = $this->ti

我试图在woocommerce中的“添加到购物车”按钮之后,在单个产品页面上回应定制配送的标题

我在这里使用了定制的shipping类插件()

我可以在购物车页面回显标题,但无法在单个产品页面上回显标题

通过使用上述功能:

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
    }
我可以挂在购物车页面,但不能挂在产品页面

我不知道我哪里做错了什么

谢谢你的帮助

谢谢