Update form-shipping.php
Add filter to allow needs_shipping() to be overridden, useful if you want to collect a shipping address for virtual products. Allows a filter to be used as replacement for get_option('woocommerce_require_shipping_address') Previous suggestion of add_filter('woocommerce_cart_needs_shipping', '__return_true'); is not suitable
This commit is contained in:
parent
0ada403433
commit
6cb5451e15
|
@ -10,7 +10,7 @@
|
|||
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||
?>
|
||||
<div class="woocommerce-shipping-fields">
|
||||
<?php if ( WC()->cart->needs_shipping() && ! WC()->cart->ship_to_billing_address_only() ) : ?>
|
||||
<?php if ( ( WC()->cart->needs_shipping() || apply_filters('woocommerce_override_needs_shipping' , false ) == true ) && ! WC()->cart->ship_to_billing_address_only() ) : ?>
|
||||
|
||||
<?php
|
||||
if ( empty( $_POST ) ) {
|
||||
|
@ -65,4 +65,4 @@ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
|||
<?php endif; ?>
|
||||
|
||||
<?php do_action( 'woocommerce_after_order_notes', $checkout ); ?>
|
||||
</div>
|
||||
</div>
|
||||
|
|
Loading…
Reference in New Issue