4 replies [Last post]
xerbutter's picture
Offline
Bug Finder
Joined: 09/07/2007
Juice: 146
Was this information Helpful?

I just noticed that the Shipping Address section of the customer invoice looks a bit odd when it is prepared for a non-shippable item. It shows up like this:

Shipping Address:

, NY 10007

(checked it on the livetest too).

Is there an easy way to disable the shipping address output, but only when the order is made up of non-shippable items? It's done with a Token right now, which makes it all or nothing...

Thanks.

Ryan's picture
Offline
Joined: 08/07/2007
Juice: 15438
Re: customer invoice for non-shippable item

Agreed.. there are other places that could benefit from an order_is_shippable() function... see this post for another case. I hope to implement this, and then we can add a check for that in the default invoice template to not show any shipping related info for non-shippable orders.

xerbutter's picture
Offline
Bug Finder
Joined: 09/07/2007
Juice: 146
Re: Re: customer invoice for non-shippable item

Sounds great. Thanks.

Lyle's picture
Offline
AdministratoreLiTe!
Joined: 08/07/2007
Juice: 6846
uc_order_is_shippable() has

uc_order_is_shippable() has been committed. And it's a workflow-ng condition too!

xerbutter's picture
Offline
Bug Finder
Joined: 09/07/2007
Juice: 146
Perfect! Putting an if

Perfect!

Putting an if around the shipping section in the invoice template gets the job done nicely now:

<?php if (uc_order_is_shippable($order)): ?>
<b><?php echo t('Shipping Address:'); ?></b><br />
[order-shipping-address]<br />
<?php endif; ?>

By the way, it looks like you left this in the uc_order_is_shippable() function:

drupal_set_message('<pre>'. print_r($results, true) .'</pre>');