Dle návodu pro 2.6.x na http://docs.woothemes.com/document/hide-other-shipping-methods-when-free-shipping-is-available/
function ceske_sluzby_omezit_dopravu_pokud_dostupna_zdarma( $rates, $package ) {
$omezit_dopravu = get_option( 'wc_ceske_sluzby_dalsi_nastaveni_doprava-pouze-zdarma' );
if ( $omezit_dopravu == "yes" ) {
$free = array();
foreach ( $rates as $rate_id => $rate ) {
if ( 'free_shipping' === $rate->method_id ) {
$free[ $rate_id ] = $rate;
break;
}
}
return ! empty( $free ) ? $free : $rates;
}
}
-
This reply was modified 9 years, 8 months ago by Lukas.
Thread Starter
Lukas
(@lukasdan)
I forgot for second bug.
When I have week menu and normal menu on same page – just first menu is showing.
Maybe because the same variable $html on return?
I replaced do_shortcode in week menu and paste same code from normal menu, then changed $html to $html_week, then it showed both menus.