在woocommerce传递方法列表中使用我的默认组织

问题描述

我的网站的交付方式按价格进行组织,我希望按自己的方式进行组织 WooCommerce>配置>交付>交付区域名称>交付方式的组织。

尝试输入的代码

/*=Use the shipping method filter to set the "selected" shipping method to
 * use the first (default) method in the available methods list
**************************************************************************/
function my_reset_default_shipping_method( $method,$available_methods ) {

    // get the id of the first method in the list
    $method = key($available_methods);
    return $method;

}
add_filter('woocommerce_shipping_chosen_method','my_reset_default_shipping_method',10,2); 

我尝试使用下面的代码,但是我没有成功,即使放置和更新缓存和传递方法,仍然按价格组织。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)