php Mostrar独家envío免费提供ocultar resto

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了php Mostrar独家envío免费提供ocultar resto相关的知识,希望对你有一定的参考价值。

/**
 * Hide shipping rates when free shipping is available.
 * Updated to support WooCommerce 2.6 Shipping Zones.
 *
 * @param array $rates Array of rates found for the package.
 * @return array
 */
function my_hide_shipping_when_free_is_available( $rates ) {
	$free = array();
	foreach ( $rates as $rate_id => $rate ) {
		if ( 'free_shipping' === $rate->method_id ) {
			$free[ $rate_id ] = $rate;
			break;
		}
	}
	return ! empty( $free ) ? $free : $rates;
}
add_filter( 'woocommerce_package_rates', 'my_hide_shipping_when_free_is_available', 100 );

以上是关于php Mostrar独家envío免费提供ocultar resto的主要内容,如果未能解决你的问题,请参考以下文章

php Mostrar选择con post de lamismaclassíamenosel mismo

php Mostrar TODOSlostérminosdeunataononomíaparael item activo(WP)

php Cantidad restante hastaconseguirenvío免费

php 庞尔¡免费! en vez de 0€ovacío

php [WooCommerce] Mostrar“valor economizado”dos produtosempromoção

php Mostrar imagen destacada(WP)