Hide shipping costs until address is entered

This commit is contained in:
Coen Jacobs 2012-04-11 13:00:56 +02:00
parent 134edeb0b3
commit 2369787b6b
2 changed files with 11 additions and 2 deletions

View File

@ -848,6 +848,15 @@ $woocommerce_settings['shipping'] = apply_filters('woocommerce_shipping_settings
'id' => 'woocommerce_enable_shipping_calc',
'std' => 'yes',
'type' => 'checkbox',
'checkboxgroup' => ''
),
array(
'name' => __( 'Shipping calculations', 'woocommerce' ),
'desc' => __( 'Hide shipping costs until address is entered', 'woocommerce' ),
'id' => 'woocommerce_hide_shipping_address',
'std' => 'no',
'type' => 'checkbox',
'checkboxgroup' => 'end'
),

View File

@ -31,7 +31,7 @@ $available_methods = $woocommerce->shipping->get_available_shipping_methods();
<?php endif; ?>
<?php if ($woocommerce->cart->needs_shipping() && ( $available_methods || get_option('woocommerce_enable_shipping_calc') == 'yes' )) : ?>
<?php if ( $woocommerce->cart->needs_shipping() && ( $available_methods || get_option( 'woocommerce_enable_shipping_calc' ) == 'yes' ) && get_option( 'woocommerce_hide_shipping_address' ) != 'yes' ) { ?>
<tr class="shipping">
<th><?php _e('Shipping', 'woocommerce'); ?></th>
@ -95,7 +95,7 @@ $available_methods = $woocommerce->shipping->get_available_shipping_methods();
</tr>
<?php endif; ?>
<?php } ?>
<?php
if (get_option('woocommerce_display_cart_taxes')=='yes' && $woocommerce->cart->get_cart_tax()) :