Support » Plugin: WooCommerce » Possible Bug With Virtual Products

  • Hi,

    Just wanted to run this by someone as I wanted to be sure whether this should be raised as a bug or whether I have totally misunderstood. I have created a store which is only going to sell virtual products.

    I wanted to remove the Order Notes field which I did by using the “woocommerce_checkout_fields” filter but I am left with the heading “Additional Fields” which I wanted to remove also.

    I look at the template code and in particular checkout/form-shipping.php which, at line 58, gives us:

    <?php if ( ! WC()->cart->needs_shipping() || WC()->cart->ship_to_billing_address_only() ) : ?>
    
    			<h3><?php _e( 'Additional Information', 'woocommerce' ); ?></h3>
    
    		<?php endif; ?>

    So this is saying that if the cart does not need shipping or we’re just delivering to the billing address, then display “Additional Information”. Shouldn’t this be “if the product does need shipping or we’re not delivering to the billing address then display “Additional Information” (this may be better as an “AND” statement possibly). i.e.

    <?php if ( WC()->cart->needs_shipping() || ! WC()->cart->ship_to_billing_address_only() ) : ?>
    
    			<h3><?php _e( 'Additional Information', 'woocommerce' ); ?></h3>
    
    		<?php endif; ?>

    It’s Monday so forgive me in advance…!

    https://wordpress.org/plugins/woocommerce/

  • The topic ‘Possible Bug With Virtual Products’ is closed to new replies.