【发布时间】:2014-08-16 17:55:07
【问题描述】:
wc-cart-functions.php
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 .= ' (' . __( 'Free', 'woocommerce' ) . ')';
}
return apply_filters( 'woocommerce_cart_shipping_method_full_label', $label, $method );
}
函数返回$label,$method,我想显示$method,$label
无法更改顺序
我想更改[价格-送货方式]的顺序,因为系统显示[送货方式-价格]
目前,结帐页面如下所示:
Cart Subtotal $300.00
Shipping **Ship To An International Destination: $35.00** *CHANGE*
Order Total $335.00
因为我可以将 CHECKOUT 页面更改为如下所示;
Cart Subtotal $300.00
Shipping and Handling **$35.00 Ship To An International Destination** *CHANGE*
Order Total $335.00
【问题讨论】:
-
cart-shipping.php 刚刚找到解决办法,这个函数的返回,wp_kses_post( wc_cart_totals_shipping_method_label( $method ) );我只是使用带有 split 功能的分隔符来更改出现的顺序。 谢谢
标签: woocommerce shipping