Skip to content

Commit 156f13b

Browse files
committed
Shipping address was not coming in the invoice when the order was created manually.
Fixes #121 #155
1 parent 85546d5 commit 156f13b

File tree

3 files changed

+1
-32
lines changed

3 files changed

+1
-32
lines changed

woocommerce-delivery-notes/includes/wcdn-template-functions.php

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -353,23 +353,6 @@ function wcdn_additional_product_fields( $fields, $product, $order ) {
353353
return array_merge( $fields, $new_fields );
354354
}
355355

356-
/**
357-
* Check if a shipping address is enabled
358-
*
359-
* @param object $order Order object.
360-
*/
361-
function wcdn_has_shipping_address( $order ) {
362-
// Works only with WooCommerce 2.2 and higher.
363-
if ( version_compare( WC_VERSION, '2.2.0', '>=' ) ) {
364-
if ( ! wc_ship_to_billing_address_only() && $order->needs_shipping_address() && 'no' !== get_option( 'woocommerce_calc_shipping' ) ) {
365-
return true;
366-
} else {
367-
return false;
368-
}
369-
}
370-
return true;
371-
}
372-
373356
/**
374357
* Check if an order contains a refund
375358
*

woocommerce-delivery-notes/templates/print-order/print-content.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,7 @@
3030
<?php do_action( 'wcdn_after_branding', $order ); ?>
3131
</div><!-- .order-branding -->
3232

33-
<div class="order-addresses
34-
<?php
35-
if ( ! wcdn_has_shipping_address( $order ) ) :
36-
?>
37-
no-shipping-address<?php endif; ?>">
33+
<div class="order-addresses">
3834
<div class="billing-address">
3935
<h3><?php esc_attr_e( 'Billing Address', 'woocommerce-delivery-notes' ); ?></h3>
4036
<address>

woocommerce-delivery-notes/templates/print-order/style.css

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -169,16 +169,6 @@ h2 {
169169
float: left;
170170
}
171171

172-
.order-addresses.no-shipping-address .shipping-address {
173-
display: none;
174-
}
175-
176-
/*
177-
.order-addresses.no-shipping-address .billing-address {
178-
margin-left: 50%;
179-
}
180-
*/
181-
182172
/* Switch the addresses for invoices */
183173

184174
/* Order Info */

0 commit comments

Comments
 (0)