脚本宝典收集整理的这篇文章主要介绍了php – 免费送货标签的WooCommerce自定义功能,脚本宝典觉得挺不错的,现在分享给大家,也给大家做个参考。
elseif ( $method->id !== 'free_shipping' ) { $label .= ' (' . __( '**Free**','woocommerce' ) . ')';
对…
elseif ( $method->id !== 'free_shipping' ) { $label .= ' (' . __( '**To Be Calculated**','woocommerce' ) . ')';
当我更改原始woocommerce / includes / wc-cart-functions.PHP中的一个单词时,它可以完美地运行.我不希望它被更新覆盖.
/** * Get a shipping methods full label including PRice * @param object $method * @return string */ function wc_cart_totals_shipping_method_label( $method ) { $label = $method->label; if ( $method->cost > 0 ) { if ( WC()->cart->tax_display_cart == 'excl' ) { $label .= ': ' . wc_price( $method->cost ); if ( $method->get_shipping_tax() > 0 && WC()->cart->prices_include_tax ) { $label .= ' <small>' . WC()->countries->ex_tax_or_vat() . '</small>'; } } else { $label .= ': ' . wc_price( $method->cost + $method->get_shipping_tax() ); if ( $method->get_shipping_tax() > 0 && ! WC()->cart->prices_include_tax ) { $label .= ' <small>' . WC()->countries->inc_tax_or_vat() . '</small>'; } } } elseif ( $method->id !== 'free_shipping' ) { $label .= ' (' . __( 'To Be Calculated','woocommerce' ) . ')'; } return apply_filters( 'woocommerce_cart_shipping_method_full_label',$label,$method ); }
add_filter( 'woocommerce_cart_shipping_method_full_label','remove_local_pickup_free_label',10,2 ); function remove_local_pickup_free_label($full_label,$method){ $full_label = str_replace("(Free)","(TBD)",$full_label); return $full_label; }
以上是脚本宝典为你收集整理的php – 免费送货标签的WooCommerce自定义功能全部内容,希望文章能够帮你解决php – 免费送货标签的WooCommerce自定义功能所遇到的问题。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。